diff --git a/.travis.yml b/.travis.yml index 4f122dc5..d14c2c6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,8 @@ python: env: - UPGRADES="-U --only-binary 'pint,pandas' pint pandas" - UPGRADES="" -jobs: - exclude: - - python: '3.12' - env: UPGRADES="" install: - pip install --only-binary ':all:' -r requirements.txt - - test $TRAVIS_PYTHON_VERSION != "3.12" || perl -pi -E 's/^.*(?:pandas|flake8-docstrings).*$//' test_requirements.txt - pip install --only-binary ':all:' -r test_requirements.txt - pip install $UPGRADES -e . script: diff --git a/doc_requirements.txt b/doc_requirements.txt new file mode 100644 index 00000000..0a0a47d2 --- /dev/null +++ b/doc_requirements.txt @@ -0,0 +1,3 @@ +sphinx==5.0.0 +sphinx-rtd-theme==1.0.0 +sphinxcontrib-apidoc==0.3.0 diff --git a/gemd/__version__.py b/gemd/__version__.py index 4bd6f7be..e2f88eea 100644 --- a/gemd/__version__.py +++ b/gemd/__version__.py @@ -1 +1 @@ -__version__ = "1.18.2" +__version__ = "1.18.4" diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh index e42c72bc..97bd975c 100755 --- a/scripts/build_docs.sh +++ b/scripts/build_docs.sh @@ -1,3 +1,4 @@ +pip install -r doc_requirements.txt cd docs make html touch _build/html/.nojekyll diff --git a/scripts/validate-version-bump.sh b/scripts/validate-version-bump.sh deleted file mode 100755 index 318acee7..00000000 --- a/scripts/validate-version-bump.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -set -eu - -extract_version() { - sed -En "s/.*version='([0-9]+\.[0-9]+\.[0-9]+).*/\1/p" <<< "$@" -} - -extract_major() { - sed -En "s/([0-9]+).*/\1/p" <<< "$1" -} - -extract_minor() { - sed -En "s/.*\.([0-9]+)\..*/\1/p" <<< "$1" -} - -extract_patch() { - sed -En "s/.*\.([0-9]+)/\1/p" <<< "$1" -} - -trap "$(set +eu)" EXIT - -CURRENT="$(extract_version $(cat setup.py))" -MAIN="$(extract_version $(git show main:setup.py))" - -CURRENT_MAJOR="$(extract_major ${CURRENT})" -CURRENT_MINOR="$(extract_minor ${CURRENT})" -CURRENT_PATCH="$(extract_patch ${CURRENT})" - -MAIN_MAJOR="$(extract_major ${MAIN})" -MAIN_MINOR="$(extract_minor ${MAIN})" -MAIN_PATCH="$(extract_patch ${MAIN})" - -if [ "${CURRENT_MAJOR}" -gt "${MAIN_MAJOR}" ]; then - echo "major version bump" - exit 0 -elif [ "${CURRENT_MAJOR}" -lt "${MAIN_MAJOR}" ]; then - echo "error - major version decreased!" - exit 1 -else - if [ "${CURRENT_MINOR}" -gt "${MAIN_MINOR}" ]; then - echo "minor version bump" - exit 0 - elif [ "${CURRENT_MINOR}" -lt "${MAIN_MINOR}" ]; then - echo "error - minor version decreased!" - exit 2 - else - if [ "${CURRENT_PATCH}" -gt "${MAIN_PATCH}" ]; then - echo "patch version bump" - exit 0 - elif [ "${CURRENT_PATCH}" -lt "${MAIN_PATCH}" ]; then - echo "error - patch version decreased!" - exit 3 - else - echo "error - version unchanged!" - exit 4 - fi - fi -fi diff --git a/setup.py b/setup.py index a127cd1c..4954131f 100644 --- a/setup.py +++ b/setup.py @@ -41,13 +41,14 @@ ], extras_require={ "tests": [ - "pytest>=7.3.1,<8" + "pytest>=8.0.0,<9" ], "tests.demo": [ - "pandas>=1.3.5,<3" + "pandas>=2.0.3,<3" ], "tests.entity.bounds": [ - "numpy" + "numpy>=1.24.4,<2", + "pandas>=2.0.3,<3" ] }, classifiers=[ diff --git a/test_requirements.txt b/test_requirements.txt index c27fa53b..cd3f154c 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,10 +1,6 @@ -flake8==6.1.0 +flake8==7.0.0 flake8-docstrings==1.7.0 -pytest==7.3.1 -pytest-cov==4.0.0 -pandas==1.5.0 -toolz==0.12.0 +pytest==8.0.0 +pytest-cov==4.1.0 +pandas>=2.0.3,<2.2.0 derp==0.1.1 -sphinx==5.0.0 -sphinx-rtd-theme==1.0.0 -sphinxcontrib-apidoc==0.3.0 diff --git a/tests/entity/bounds/test_categorical_bounds.py b/tests/entity/bounds/test_categorical_bounds.py index 40b34d02..92b1830a 100644 --- a/tests/entity/bounds/test_categorical_bounds.py +++ b/tests/entity/bounds/test_categorical_bounds.py @@ -70,7 +70,7 @@ def test_numpy(): np_copy = loads(dumps(np_bounds)) assert np_copy == np_bounds - if len(array_like()) > 3: # Test numpy + if len(array_like()) > 3: # Test pandas import pandas as pd pd_bounds = CategoricalBounds(pd.Series(["spam", "eggs"])) pd_copy = loads(dumps(pd_bounds)) diff --git a/tests/test_examples.py b/tests/test_examples.py index 05052a0d..1ba913cd 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,16 +1,13 @@ """Test of a complicated set of interlocking data objects.""" import json -from gemd.entity.object.ingredient_run import IngredientRun -from toolz import keymap, merge, keyfilter - from gemd.json import dumps from gemd.entity.attribute.condition import Condition from gemd.entity.attribute.parameter import Parameter from gemd.entity.attribute.property import Property from gemd.entity.bounds.real_bounds import RealBounds from gemd.entity.object import MeasurementRun, MaterialRun, ProcessRun, ProcessSpec,\ - MeasurementSpec, MaterialSpec + MeasurementSpec, MaterialSpec, IngredientRun from gemd.entity.template.condition_template import ConditionTemplate from gemd.entity.template.material_template import MaterialTemplate from gemd.entity.template.measurement_template import MeasurementTemplate @@ -45,13 +42,13 @@ def make_data_island(density, bulk_modulus, firing_temperature, binders, powders, tag=None): """Helper function to create a relatively involved data island.""" - binder_specs = keymap(lambda x: MaterialSpec(name=x), binders) - powder_specs = keymap(lambda x: MaterialSpec(name=x), powders) + binder_specs = {MaterialSpec(name=k): v for k, v in binders.items()} + powder_specs = {MaterialSpec(name=k): v for k, v in powders.items()} - binder_runs = keymap(lambda x: MaterialRun(name=x.name, spec=x), binder_specs) - powder_runs = keymap(lambda x: MaterialRun(name=x.name, spec=x), powder_specs) + binder_runs = {MaterialRun(name=k.name, spec=k): v for k, v in binder_specs.items()} + powder_runs = {MaterialRun(name=k.name, spec=k): v for k, v in powder_specs.items()} - all_input_materials = keymap(lambda x: x.spec.name, merge(binder_runs, powder_runs)) + all_input_materials = {k.spec.name: v for k, v in binder_runs.items() | powder_runs.items()} mixing_composition = Condition( name="composition", value=NominalComposition(all_input_materials) @@ -161,9 +158,7 @@ def test_access_data(): # read the quantity of alumina quantities = island.process.ingredients[0].material.process.conditions[0].value.quantities - assert(list( - keyfilter(lambda x: x == "Al2O3", quantities).values() - )[0] == 0.96) + assert quantities.get("Al2O3") == 0.96 # check that the serialization results in the correct number of objects in the preface # (note that neither measurements nor ingredients are serialized)