Skip to content

Commit

Permalink
Merge branch 'main' into rm
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv committed Feb 19, 2024
2 parents 36c311a + 14f40e7 commit 4ebddd3
Show file tree
Hide file tree
Showing 126 changed files with 5,169 additions and 6,105 deletions.
57 changes: 0 additions & 57 deletions .ci_support/condamerge.py

This file was deleted.

34 changes: 20 additions & 14 deletions .ci_support/environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ channels:
- conda-forge
dependencies:
- nbsphinx
- dill
- gitpython
- h5io
- h5py
- jinja2
- sphinx
- sphinx_rtd_theme
- myst-parser
- numpy
- pandas
- pint
- psutil
- pyfileindex
- pysqa
- pytables
- sqlalchemy
- tqdm
- traitlets
- cloudpickle =3.0.0
- gitpython =3.1.42
- h5io_browser =0.0.9
- h5py =3.10.0
- jinja2 =3.1.3
- monty =2024.2.2
- numpy =1.26.4
- pandas =2.2.0
- pint =0.23
- psutil =5.9.8
- pyfileindex =0.0.22
- pympipool =0.7.13
- pysqa =0.1.15
- pytables =3.9.2
- sqlalchemy =2.0.27
- tqdm =4.66.2
- traitlets =5.14.1
6 changes: 3 additions & 3 deletions .ci_support/environment-notebooks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
channels:
- conda-forge
- conda-forge
dependencies:
- jupyter
- papermill
- jupyter
- papermill
20 changes: 20 additions & 0 deletions .ci_support/environment-old.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
channels:
- conda-forge
dependencies:
- cloudpickle =2.0.0
- gitpython =3.1.23
- h5io_browser =0.0.6
- h5py =3.6.0
- jinja2 =2.11.3
- monty =2021.3.3
- numpy =1.23.5
- pandas =2.0.0
- pint =0.18
- psutil =5.8.0
- pyfileindex =0.0.16
- pympipool =0.7.11
- pysqa =0.1.12
- pytables =3.6.1
- sqlalchemy =2.0.22
- tqdm =4.44.0
- traitlets =5.1.1
33 changes: 18 additions & 15 deletions .ci_support/environment.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
channels:
- conda-forge
dependencies:
- coveralls
- coverage
- codacy-coverage
- dill =0.3.7
- gitpython =3.1.37
- h5io =0.1.9
- conda =23.11.0
- conda_subprocess =0.0.1
- cloudpickle =3.0.0
- gitpython =3.1.42
- h5io_browser =0.0.9
- h5py =3.10.0
- jinja2 =3.1.2
- numpy =1.26.0
- pandas =2.1.1
- pint =0.22
- psutil =5.9.5
- pyfileindex =0.0.12
- pysqa =0.1.3
- pytables =3.9.1
- sqlalchemy =2.0.22
- tqdm =4.66.1
- traitlets =5.11.2
- jinja2 =3.1.3
- monty =2024.2.2
- numpy =1.26.4
- pandas =2.2.0
- pint =0.23
- psutil =5.9.8
- pyfileindex =0.0.22
- pympipool =0.7.13
- pysqa =0.1.15
- pytables =3.9.2
- sqlalchemy =2.0.27
- tqdm =4.66.2
- traitlets =5.14.1
2 changes: 2 additions & 0 deletions .ci_support/pip_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip install versioneer[toml]==0.29
pip install . --no-deps --no-build-isolation
10 changes: 2 additions & 8 deletions .ci_support/pypi_vs_conda_names.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"tables": "pytables",
"pyiron-base": "pyiron_base",
"pyiron-atomistics": "pyiron_atomistics",
"pyiron-contrib": "pyiron_contrib",
"pyiron-experimental": "pyiron_experimental",
"pyiron-continuum": "pyiron_continuum",
"pyiron-gpl": "pyiron_gpl",
"pyiron-gui": "pyiron_gui"
}
"blosc2": "python-blosc2"
}
79 changes: 79 additions & 0 deletions .ci_support/release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import json


def get_setup_version_and_pattern(setup_content):
depend_lst, version_lst = [], []
for l in setup_content:
if '==' in l:
lst = l.split('[')[-1].split(']')[0].replace(' ', '').replace('"', '').replace("'", '').split(',')
for dep in lst:
if dep != '\n':
version_lst.append(dep.split('==')[1])
depend_lst.append(dep.split('==')[0])

version_high_dict = {d: v for d, v in zip(depend_lst, version_lst)}
return version_high_dict


def get_env_version(env_content):
read_flag = False
depend_lst, version_lst = [], []
for l in env_content:
if 'dependencies:' in l:
read_flag = True
elif read_flag:
lst = l.replace('-', '').replace(' ', '').replace('\n', '').split("=")
if len(lst) == 2:
depend_lst.append(lst[0])
version_lst.append(lst[1])
return {d:v for d, v in zip(depend_lst, version_lst)}


def update_dependencies(setup_content, version_low_dict, version_high_dict):
version_combo_dict = {}
for dep, ver in version_high_dict.items():
if dep in version_low_dict.keys() and version_low_dict[dep] != ver:
version_combo_dict[dep] = dep + ">=" + version_low_dict[dep] + ",<=" + ver
else:
version_combo_dict[dep] = dep + "==" + ver

setup_content_new = ""
pattern_dict = {d:d + "==" + v for d, v in version_high_dict.items()}
for l in setup_content:
for k, v in pattern_dict.items():
if v in l:
l = l.replace(v, version_combo_dict[k])
setup_content_new +=l
return setup_content_new


def convert_key(key, convert_dict):
if key not in convert_dict.keys():
return key
else:
return convert_dict[key]


if __name__ == "__main__":
with open('.ci_support/pypi_vs_conda_names.json', 'r') as f:
name_conversion_dict = {v: k for k, v in json.load(f).items()}

with open('pyproject.toml', "r") as f:
setup_content = f.readlines()

with open('environment.yml', "r") as f:
env_content = f.readlines()

env_version_dict = {
convert_key(key=k, convert_dict=name_conversion_dict): v
for k, v in get_env_version(env_content=env_content).items()
}

setup_content_new = update_dependencies(
setup_content=setup_content[2:],
version_low_dict=env_version_dict,
version_high_dict=get_setup_version_and_pattern(setup_content=setup_content[2:]),
)

with open('pyproject.toml', "w") as f:
f.writelines("".join(setup_content[:2]) + setup_content_new)
5 changes: 3 additions & 2 deletions .ci_support/test_backwards.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/bash

pip install --no-deps pyiron_base==0.1.21
pip install pyiron_base==0.1.21 --no-deps
echo "Before save";
for t in tests/backwards/*save.py; do
echo "Running $t";
python $t
done

pip install --no-deps .
pip install versioneer[toml]==0.29
pip install . --no-deps --no-build-isolation
i=0;
echo "Before loading";
for t in tests/backwards/*load.py; do
Expand Down
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

3 changes: 0 additions & 3 deletions .github/delete-merged-branch-config.yml

This file was deleted.

49 changes: 13 additions & 36 deletions .github/workflows/atomistics-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ jobs:
matrix:
include:
- operating-system: macos-latest
python-version: '3.10'
python-version: '3.11'
label: osx-64-py-3-10
prefix: /Users/runner/miniconda3/envs/my-env

- operating-system: windows-latest
python-version: '3.10'
python-version: '3.11'
label: win-64-py-3-10
prefix: C:\Miniconda3\envs\my-env

- operating-system: ubuntu-latest
python-version: '3.10'
python-version: '3.11'
label: linux-64-py-3-10
prefix: /usr/share/miniconda3/envs/my-env

steps:
- uses: actions/checkout@v2
- name: pyiron_atomistic
- uses: actions/checkout@v4
- name: Merge environment
run: |
pip install PyYAML
git clone https://github.com/pyiron/pyiron_atomistics ../pyiron_atomistics
grep -v "pyiron_base" ../pyiron_atomistics/.ci_support/environment.yml > ../pyiron_atomistics/environment.yml
python .ci_support/condamerge.py --base .ci_support/environment.yml --add ../pyiron_atomistics/environment.yml > environment.yml
cp .ci_support/environment.yml environment.yml
tail --lines=+4 ../pyiron_atomistics/environment.yml >> environment.yml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -50,38 +50,15 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: environment.yml
use-mamba: true
- name: Set cache date and number
run: |
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
cat .github/variables/cache_number.env >> $GITHUB_ENV
- uses: actions/cache@v2
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache
- name: Update environment
run: mamba env update -n my-env -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: pyironconfig
shell: bash -l {0}
run: |
cd ../pyiron_atomistics
python .ci_support/pyironconfig.py
cd ../pyiron_base
- name: Install pyiron_atomistics
shell: bash -l {0}
run: |
cd ../pyiron_atomistics
pip install --no-deps .
cd ../pyiron_base
- name: Install pyiron_base
shell: bash -l {0}
run: |
pip install --no-deps .
- name: Test
- name: Tests
shell: bash -l {0}
timeout-minutes: 30
run: |
pip install versioneer[toml]==0.29
pip install . --no-deps --no-build-isolation
cd ../pyiron_atomistics
pip install . --no-deps --no-build-isolation
python .ci_support/pyironconfig.py
python -m unittest discover tests/
Loading

0 comments on commit 4ebddd3

Please sign in to comment.