Skip to content

Commit

Permalink
ci: more more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliacomi committed Feb 2, 2022
1 parent 3f34107 commit 5be1e11
Show file tree
Hide file tree
Showing 10 changed files with 509 additions and 306 deletions.
12 changes: 12 additions & 0 deletions .dev.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Configuration for debugging
:
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"env": {"PYTEST_ADDOPTS": "--no-cov"}
}
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ New features:

Changes:

* removed other_keys syntax
* move all test data somewhere
* removed smart naming of isotherm parameters
* branches are internally 0,1 instead of false/true

* Isotherm ``material`` and ``adsorbate`` are now always instantiated as
``pygaps.Material`` and ``pygaps.Adsorbate`` classes.
* Added a "zero" thickness model that assumes no mono/multilayer sorption.
Expand Down
1 change: 1 addition & 0 deletions ci/templates/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ usedevelop =
deps =
pytest
cover: coverage[toml]
cover: tomlkit
cover: pytest-cov
commands =
cover: python setup.py clean --all build_ext --force --inplace
Expand Down
18 changes: 12 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""Configuration for documentation building"""
# -- Init -----------------------------------------------------

import os
import sys
Expand All @@ -12,6 +12,7 @@
html_theme = 'sphinx_rtd_theme'


# -- Mocking of modules -----------------------------------------------------
# Need to mock modules using MagicMock, as they won't be able to
# be installed on readthedocs
class Mock(MagicMock):
Expand Down Expand Up @@ -57,7 +58,7 @@ def __getattr__(cls, name):
]
# If currently spellchecking
if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling',
extensions += 'sphinxcontrib.spelling'
spelling_show_suggestions = True
spelling_lang = 'en_US'

Expand All @@ -71,7 +72,7 @@ def __getattr__(cls, name):
project = 'pygaps'
year = '2021'
author = 'Paul Iacomi'
copyright = '{0}, {1}'.format(year, author)
copyright = f'{year}, {author}'
try:
from importlib.metadata import version as imp_version
version = release = imp_version("pygaps")
Expand All @@ -83,14 +84,19 @@ def __getattr__(cls, name):
templates_path = ['.']

# Needed for jupyter notebook compilation by nbsphinx
exclude_patterns = ['_build', '**.ipynb_checkpoints']
exclude_patterns = [
'_build',
'**.ipynb_checkpoints',
]

# Needed for jupyter notebook compilation by nbsphinx
pygments_style = 'trac'

# Suppressing the nonlocal_uri image warning, as it appears due to
# github badges being stored on another server
suppress_warnings = ['image.nonlocal_uri']
suppress_warnings = [
'image.nonlocal_uri',
]

# External links
extlinks = {
Expand Down
228 changes: 130 additions & 98 deletions docs/examples/area_calcs.ipynb

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/examples/import.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"source": [
"from pathlib import Path\n",
"import matplotlib.pyplot as plt\n",
"import pygaps\n",
"import pygaps.parsing as pgp \n",
"\n",
"json_path = Path.cwd() / 'data'"
]
Expand All @@ -40,8 +40,8 @@
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Selected 5 isotherms with nitrogen at 77K\n"
]
Expand All @@ -52,7 +52,7 @@
"isotherms_n2_77k_paths = list(Path(json_path / 'characterisation').rglob(\"*.json\" ))\n",
"isotherms_n2_77k = []\n",
"for filepath in isotherms_n2_77k_paths:\n",
" isotherms_n2_77k.append(pygaps.isotherm_from_json(filepath))\n",
" isotherms_n2_77k.append(pgp.isotherm_from_json(filepath))\n",
" \n",
"print('Selected', len(isotherms_n2_77k), 'isotherms with nitrogen at 77K')"
]
Expand All @@ -63,8 +63,8 @@
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Selected 2 room temperature calorimetry isotherms\n"
]
Expand All @@ -75,7 +75,7 @@
"isotherms_calorimetry_paths = list(Path(json_path / 'calorimetry').rglob(\"*.json\" ))\n",
"isotherms_calorimetry = []\n",
"for filepath in isotherms_calorimetry_paths:\n",
" isotherms_calorimetry.append(pygaps.isotherm_from_json(filepath))\n",
" isotherms_calorimetry.append(pgp.isotherm_from_json(filepath))\n",
" \n",
"print('Selected', len(isotherms_calorimetry), 'room temperature calorimetry isotherms')"
]
Expand All @@ -86,8 +86,8 @@
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Selected 2 isotherms for IAST calculation\n"
]
Expand All @@ -98,7 +98,7 @@
"isotherms_iast_paths = list(Path(json_path / 'iast').rglob(\"*.json\" ))\n",
"isotherms_iast = []\n",
"for filepath in isotherms_iast_paths:\n",
" isotherms_iast.append(pygaps.isotherm_from_json(filepath))\n",
" isotherms_iast.append(pgp.isotherm_from_json(filepath))\n",
" \n",
"print('Selected', len(isotherms_iast), 'isotherms for IAST calculation')"
]
Expand All @@ -109,8 +109,8 @@
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Selected 3 isotherms for isosteric enthalpy calculation\n"
]
Expand All @@ -121,7 +121,7 @@
"isotherms_isosteric_paths = list(Path(json_path / 'isosteric').rglob(\"*.json\" ))\n",
"isotherms_isosteric = []\n",
"for filepath in isotherms_isosteric_paths:\n",
" isotherms_isosteric.append(pygaps.isotherm_from_json(filepath))\n",
" isotherms_isosteric.append(pgp.isotherm_from_json(filepath))\n",
" \n",
"print('Selected', len(isotherms_isosteric), 'isotherms for isosteric enthalpy calculation')"
]
Expand All @@ -148,4 +148,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
190 changes: 114 additions & 76 deletions docs/examples/psd.ipynb

Large diffs are not rendered by default.

334 changes: 222 additions & 112 deletions docs/examples/quickstart.ipynb

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions docs/manual/isotherm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ calorimetry data, magnetic field strengths, or other simultaneous measurements.

If a DataFrame is used, ``loading_key`` and ``pressure_key`` are required
parameters specifying which column in the DataFrame contains what data of the
isotherm. If other columns are to be stored in the isotherm object, their names
should be passed in a list as the ``other_keys`` parameter. As an example:
isotherm. Other columns in the dataframe are also stored in the isotherm object.
As an example:

::

Expand All @@ -185,8 +185,6 @@ should be passed in a list as the ``other_keys`` parameter. As an example:

loading_key='loading', # The loading column
pressure_key='pressure', # The pressure column
other_keys=['enthalpy',
'xrd_peak_1'], # The columns containing the other data

# Other required isotherm parameters

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ usedevelop =
deps =
pytest
cover: coverage[toml]
cover: tomlkit
cover: pytest-cov
commands =
cover: python setup.py clean --all build_ext --force --inplace
Expand Down

0 comments on commit 5be1e11

Please sign in to comment.