Skip to content

Commit

Permalink
Merge pull request #38 from dprada/main
Browse files Browse the repository at this point in the history
Function stack added
  • Loading branch information
dprada authored Mar 28, 2023
2 parents 1eaa211 + aa6bdec commit 076b90f
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 56 deletions.
49 changes: 32 additions & 17 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
# Nightly tests run on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * *"
- cron: "0 9 * * MON"

workflow_dispatch:

Expand All @@ -28,21 +28,18 @@ jobs:
#os: ["macOS-latest", "ubuntu-latest"] # windows-latest (https://github.com/openmm/openmm/issues/3618#issuecomment-1166019901)
#python-version: ["3.8", "3.9", "3.10"]
cfg:
- { os: ubuntu-latest, python-version: "3.7"}
- { os: ubuntu-latest, python-version: "3.8"}
- { os: ubuntu-latest, python-version: "3.9"}
#- { os: ubuntu-latest, python-version: "3.10"}
- { os: macos-latest, python-version: "3.7"}
- { os: macos-latest, python-version: "3.8"}
- { os: macos-latest, python-version: "3.9"}
#- { os: macos-latest, python-version: "3.10"}
- { os: windows-latest, python-version: "3.7"}
#- { os: windows-latest, python-version: "3.8"}
#- { os: windows-latest, python-version: "3.9"}
#- { os: windows-latest, python-version: "3.10"}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -53,32 +50,50 @@ jobs:
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
#- uses: conda-incubator/setup-miniconda@v2
# with:
# python-version: ${{ matrix.cfg.python-version }}
# environment-file: devtools/conda-envs/test_env.yaml
# #mamba-version: "*"
# #use-mamba: true
# channels: conda-forge,defaults

# activate-environment: test
# auto-update-conda: false
# auto-activate-base: false
# show-channel-urls: true

- name: Setup conda env
uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.cfg.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
#mamba-version: "*"
#use-mamba: true
channels: conda-forge,defaults
environment-name: test
channels: uibcdf, conda-forge, ambermd, defaults

activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
extra-specs: |
python==${{ matrix.cfg.python-version }}
- name: Install package

# conda setup requires this special shell
shell: bash -l {0}
run: |
python setup.py develop
conda list
- name: Checking version
- name: Info conda
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Test import module
shell: bash -l {0}
run: |
echo 'import pyunitwizard ; print(pyunitwizard.__version__)' | python
echo "::group::Importing module from home directory"
cd
pwd
echo 'import molsysmt; print("Version of the package: {}".format(molsysmt.__version__))' | python
echo "::endgroup::"
- name: Run tests

Expand Down
39 changes: 28 additions & 11 deletions .github/workflows/build_and_upload_conda_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,39 @@ jobs:
strategy:
fail-fast: false # do not cancel all in-progress jobs if any job variation fails
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"] # 3.10 with errors
python-version: ["3.8", "3.9"] # 3.10 with errors
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Conda environment creation and activation
uses: conda-incubator/setup-miniconda@v2
#- name: Conda environment creation and activation
# uses: conda-incubator/setup-miniconda@v2
# with:
# python-version: ${{ matrix.python-version }}
# environment-file: devtools/conda-envs/build_env.yaml
# #mamba-version: "*"
# #use-mamba: true
# auto-activate-base: false
# auto-update-conda: false
# show-channel-urls: true

- name: Setup conda env
uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/build_env.yaml
#mamba-version: "*"
#use-mamba: true
auto-activate-base: false
auto-update-conda: false
show-channel-urls: true

environment-name: build
channels: uibcdf, conda-forge, ambermd, defaults

extra-specs: |
python==${{ matrix.python-version }}
- name: Info conda
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Build and upload the conda packages
uses: uibcdf/[email protected]
with:
Expand Down
47 changes: 36 additions & 11 deletions .github/workflows/sphinx_docs_to_gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,52 @@ jobs:
run: |
uname -a
- name: Make conda environment
uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda
- name: Setup conda env
uses: mamba-org/provision-with-micromamba@main
with:
python-version: 3.9
environment-file: devtools/conda-envs/docs_env.yaml
#mamba-version: "*"
#use-mamba: true
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
environment-name: docs
channels: uibcdf, conda-forge, ambermd, defaults

extra-specs: |
python=="3.9"
#- name: Make conda environment
# uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda
# with:
# python-version: 3.9
# environment-file: devtools/conda-envs/docs_env.yaml
# #mamba-version: "*"
# #use-mamba: true
# auto-update-conda: false
# auto-activate-base: false
# show-channel-urls: true
- name: Installing the library
shell: bash -l {0}
run: |
python setup.py develop
conda list
- name: Checking version
- name: Info conda
shell: bash -l {0}
run: |
micromamba info
micromamba list
#- name: Info conda
# shell: bash -l {0}
# run: |
# conda info
# conda list
- name: Test import module
shell: bash -l {0}
run: |
echo 'import pyunitwizard; print(pyunitwizard.__version__)' | python
echo "::group::Importing module from home directory"
cd
pwd
echo 'import molsysmt; print("Version of the package: {}".format(molsysmt.__version__))' | python
echo "::endgroup::"
- name: Running the Sphinx to gh-pages Action
uses: uibcdf/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub Actions Build Status](https://github.com/uibcdf/PyUnitWizard/workflows/CI/badge.svg)](https://github.com/uibcdf/PyUnitWizard/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/uibcdf/PyUnitWizard/branch/master/graph/badge.svg)](https://codecov.io/gh/uibcdf/PyUnitWizard/branch/master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![](https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue.svg)](https://www.python.org/downloads/)
[![](https://img.shields.io/badge/Python-3.8%20%7C%203.9-blue.svg)](https://www.python.org/downloads/)
[![Install with conda](https://img.shields.io/badge/Install%20with-conda-brightgreen.svg)](https://conda.anaconda.org/uibcdf/pyunitwizard)

There are several Python libraries to work with physical quantities in the market, such as pint, unyt or openmm.unit. Imagine that your project or workflow requires the interaction with more than one of these tools, or that you are not sure if you will work with a different quantities library in the future. Wouldn't having a unique API to work with different forms of physical quantities be a relief? PyUnitWizard just does that. It is the wizard you need in your code to change the form of your quantities with no effort.
Expand Down
Loading

0 comments on commit 076b90f

Please sign in to comment.