Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliacomi committed Mar 1, 2022
2 parents c6a4f3f + 38133cc commit 2e490dc
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 67 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version : ['3.7', '3.8', '3.9', '3.10']
python-version : ['3.6', '3.7', '3.8', '3.9', '3.10']
include:
- python-version: '3.6'
toxenv: "py37-cover,report,codecov"
- python-version: '3.7'
toxenv: "py37-cover,report,codecov"
- python-version: '3.8'
Expand All @@ -76,7 +78,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools tox tox-conda
conda install numpy pandas scipy matplotlib
# Without this there's an odd error
if [ "$RUNNER_OS" == "Windows" ]; then
conda install numpy pandas scipy matplotlib
fi
conda info
conda env list
pip --version
Expand Down
11 changes: 10 additions & 1 deletion .build.info → .release.info
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ pytest --cov --cov-report xml:coverage.xml
# scattered throughout the source code
bumpversion major/minor/patch

# Currently there is an issue with versioning
# which means that setup.cfg metadata must be
# updated manually

# Finish branch
git flow release finish x.y.z

# Push, including tags
# Push tags
git push --tags

# Check CI if project has been successfully pushed to pypi

# Update conda recipe

# Get latest hash
grayskull pypi pygaps
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

4.1.0 (2022-03-02)
------------------

New features:

* 🐍 Minimum python reduced to 3.6 to increase compatibility.
* 🎆 pyGAPS is now (actually) on ``conda-forge``.

4.0.0 (2022-02-23)
------------------

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ For merging, you should:
4. Add yourself to ``AUTHORS.rst``.

.. [1] If you don't have all the necessary python versions available
locally you can rely on Travis - it will
`run the tests <https://travis-ci.org/pauliacomi/pyGAPS/pull_requests>`_
locally you can rely on GitHub - it will
`run the tests <https://github.com/pauliacomi/pyGAPS/actions>`_
for each change you add in the pull request.
Expand Down
32 changes: 16 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,24 +149,26 @@ the program in your research.
Installation
============

The easiest way to install pyGAPS is from the command line.
Make sure that you have ``numpy``, ``scipy``, ``pandas`` and ``matplotlib``,
as well as ``CoolProp`` already installed.
The easiest way to install pyGAPS is from the command line. Using ``pip`` for
example:

.. code:: bash
pip install pygaps
`Anaconda/Conda <https://www.anaconda.com/>`__ is your best bet since it manages
environments for you. First create a new environment and use conda to
install the dependencies (or start with one that already has a full
instalation). Then use pip inside your environment.
or `Anaconda/Conda <https://www.anaconda.com/>`__:

.. code:: bash
conda create -n myenv python=3.8 numpy scipy pandas matplotlib
conda activate myenv
pip install pygaps
conda install -c conda-forge pygaps
If you are just starting out, `Anaconda/Conda <https://www.anaconda.com/>`__ is
a good bet since it manages virtual environments for you. Check out
`<https://pygaps.readthedocs.io/en/master/installation.html>`__ for more
details.

Development
===========

To install the development branch, clone the repository from GitHub.
Then install the package with pip either in regular or developer mode.
Expand All @@ -176,16 +178,14 @@ Then install the package with pip either in regular or developer mode.
git clone https://github.com/pauliacomi/pyGAPS
# then install
pip install pyGAPS/
pip install ./pyGAPS
# or in editable/develop mode
pip install -e pyGAPS/
Development
===========
pip install -e ./pyGAPS
If you want to contribute to pyGAPS or develop your own code from the package,
check out the detailed information in CONTRIBUTING.rst.
check out the detailed information in
`<https://pygaps.readthedocs.io/en/master/contributing.html>`.

Bugs or questions?
==================
Expand Down
47 changes: 18 additions & 29 deletions conda_recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{% set name = "pygaps" %}
{% set version = "4.0.2" %}
{% set version = "4.1.0" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"
name: {{ name|lower }}
version: {{ version }}

source:
url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
sha256: 2e9e15ab683f9a3f5044fd116e1a4d5215ee1705de38883d89a05eb6985c9e58
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/pygaps-{{ version }}.tar.gz
sha256: 0914aa95ebdf8aa08276f9823d42fcc02c2b48538e3dabc11d06dc25ebde08ba

build:
number: 0
noarch: python
skip: true # [py<37]
entry_points:
- pygaps = pygaps.cli:main
script: "{{ PYTHON }} -m pip install . -vv"
script: {{ PYTHON }} -m pip install . -vv
number: 0

requirements:
host:
- pip
- python >=3.6
- python
run:
- python >=3.6
- python ~=3.7
- numpy >=1.16.5
- pandas
- scipy >=1.6
- matplotlib
- matplotlib-base
- coolprop >=6.0
- gemmi
- importlib_resources # [ py <3.9 ]
- importlib-resources # [py<39]
- requests
- xlrd >=1.1
- xlwt >=1.3
Expand All @@ -37,28 +37,17 @@ requirements:
test:
imports:
- pygaps
- pygaps.characterisation
- pygaps.cli
- pygaps.core
- pygaps.data
- pygaps.graphing
- pygaps.iast
- pygaps.modelling
- pygaps.parsing
- pygaps.utilities
commands:
- pip check
- pygaps --help
requires:
- coverage
- nose
- pytest
- pytest-cov
- pip

about:
home: "https://github.com/pauliacomi/pygaps"
license: "MIT"
license_family: "MIT"
license_file: "LICENSE"
home: https://github.com/pauliacomi/pygaps
license: MIT
license_family: MIT
license_file: LICENSE
summary: "A framework for processing adsorption data for porous materials"
doc_url: "https://pygaps.readthedocs.io"
dev_url: "https://github.com/pauliacomi/pygaps"
Expand Down
16 changes: 8 additions & 8 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
Installation
============

pyGAPS is made for modern versions of Python, currently requiring at least Python 3.7.
pyGAPS is made for modern versions of Python, currently requiring at least Python 3.6.

Command line
============

The installation process should take care of the dependencies for you.
If using pip all you need to do is::
If using ``pip`` all you need to do is::

pip install pygaps

We recommend using the `Anaconda/Conda <https://www.anaconda.com/>`__ environment,
as it preinstalls most required dependencies as well as making
managing environments a breeze.
managing environments a breeze. To create a new environment with pyGAPS:

.. code-block:: bash
conda create -n py3 python=3.8 numpy scipy pandas matplotlib CoolProp
conda activate py3
pip install pygaps
conda create -n myenv python=3.8
conda activate myenv
conda install pygaps
To install the development branch, clone the repository from Github. Then
install the package, in regular or editable mode
Expand All @@ -30,10 +30,10 @@ install the package, in regular or editable mode
git clone https://github.com/pauliacomi/pyGAPS
# then install
pip install ./pyGAPS/
pip install ./pyGAPS
# alternatively in developer mode
pip install -e ./pyGAPS/
pip install -e ./pyGAPS
Dependencies
============
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "src/pygaps/_version.py"
local_scheme = 'dirty-tag'
fallback_version = '4.0.2'
fallback_version = '4.1.0'

# linting: pylint
[tool.pylint.basic]
Expand Down
13 changes: 9 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[bumpversion]
current_version = 4.0.2
current_version = 4.1.0
commit = True
tag = False
message = '{current_version} → {new_version}'

[metadata]
name = pygaps
version = 4.0.2
version = 4.1.0
description = A framework for processing adsorption data for porous materials.
long_description = file: README.rst
long_description_content_type = text/x-rst
Expand All @@ -27,6 +27,7 @@ classifiers =
Operating System :: POSIX
Operating System :: Microsoft :: Windows
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Expand All @@ -40,7 +41,7 @@ classifiers =
package_dir =
=src
packages = find:
python_requires = >=3.7
python_requires = >=3.6
zip_safe = True
include_package_data = True
tests_require =
Expand All @@ -50,7 +51,7 @@ tests_require =
nose
install_requires =
numpy >= 1.16.5
scipy >= 1.6
scipy >= 1.4
pandas
matplotlib
coolprop >= 6.0
Expand All @@ -75,6 +76,10 @@ console_scripts =

[options.extras_require]
dev =
pytest
pytest-cov
coverage[toml]
nose
yapf
isort
pylint
Expand Down
2 changes: 1 addition & 1 deletion src/pygaps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ._version import version
__version__ = version
except ImportError:
__version__ = '4.0.2'
__version__ = '4.1.0'

import sys
from .logging import logger
Expand Down
5 changes: 5 additions & 0 deletions src/pygaps/characterisation/area_bet.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,8 @@ def bet_parameters(slope, intercept, cross_section):
p_monolayer = 1 / (numpy.sqrt(c_const) + 1)
bet_area = n_monolayer * cross_section * (10**(-18)) * constants.Avogadro
return n_monolayer, p_monolayer, c_const, bet_area


def simple_bet(pressure, n_monolayer, c_const):
"""A simple BET equation returning loading at a pressure."""
return (n_monolayer * c_const * pressure / (1 - pressure) / (1 - pressure + c_const * pressure))
5 changes: 5 additions & 0 deletions src/pygaps/characterisation/area_lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,8 @@ def langmuir_parameters(slope, intercept, cross_section):
langmuir_const = 1 / (intercept * n_monolayer)
langmuir_area = n_monolayer * cross_section * (10**(-18)) * constants.Avogadro
return n_monolayer, langmuir_const, langmuir_area


def simple_lang(pressure, n_total, k_const):
"""A simple Langmuir equation returning loading at a pressure."""
return (n_total * k_const * pressure / (1 + k_const * pressure))
4 changes: 3 additions & 1 deletion src/pygaps/parsing/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def wrapper(*args, **kwargs):

db_path = kwargs.get('db_path', DATABASE)
db_path = db_path if db_path else DATABASE
conn = sqlite3.connect(db_path)
# TODO deprecate 3.6: switch below
# conn = sqlite3.connect(db_path)
conn = sqlite3.connect(str(db_path))
conn.row_factory = sqlite3.Row

try:
Expand Down
6 changes: 5 additions & 1 deletion src/pygaps/utilities/sqlite_db_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def db_create(pth: str, verbose: bool = False):
db_execute_general(pragma, pth, verbose=verbose)

# Get json files
import importlib.resources as importlib_resources
try:
import importlib.resources as importlib_resources
# TODO Deprecation after PY>3.6
except ImportError:
import importlib_resources as importlib_resources

# Get and upload adsorbate property types
ads_props_json = importlib_resources.read_text('pygaps.data', 'adsorbate_props.json')
Expand Down
4 changes: 3 additions & 1 deletion src/pygaps/utilities/sqlite_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def db_execute_general(
"""
# Attempt to connect
try:
with sqlite3.connect(pth) as db:
# TODO deprecate 3.6: switch below
# with sqlite3.connect(pth) as db:
with sqlite3.connect(str(pth)) as db:

# Get a cursor object
cursor = db.cursor()
Expand Down

0 comments on commit 2e490dc

Please sign in to comment.