Skip to content

Commit 5a4ad9c

Browse files
authored
Boost testing requirements, remove unnecessary imports (#210)
1 parent 3596c7f commit 5a4ad9c

File tree

9 files changed

+21
-89
lines changed

9 files changed

+21
-89
lines changed

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ python:
99
env:
1010
- UPGRADES="-U --only-binary 'pint,pandas' pint pandas"
1111
- UPGRADES=""
12-
jobs:
13-
exclude:
14-
- python: '3.12'
15-
env: UPGRADES=""
1612
install:
1713
- pip install --only-binary ':all:' -r requirements.txt
18-
- test $TRAVIS_PYTHON_VERSION != "3.12" || perl -pi -E 's/^.*(?:pandas|flake8-docstrings).*$//' test_requirements.txt
1914
- pip install --only-binary ':all:' -r test_requirements.txt
2015
- pip install $UPGRADES -e .
2116
script:

doc_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx==5.0.0
2+
sphinx-rtd-theme==1.0.0
3+
sphinxcontrib-apidoc==0.3.0

gemd/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.18.3"
1+
__version__ = "1.18.4"

scripts/build_docs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pip install -r doc_requirements.txt
12
cd docs
23
make html
34
touch _build/html/.nojekyll

scripts/validate-version-bump.sh

Lines changed: 0 additions & 59 deletions
This file was deleted.

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@
4141
],
4242
extras_require={
4343
"tests": [
44-
"pytest>=7.3.1,<8"
44+
"pytest>=8.0.0,<9"
4545
],
4646
"tests.demo": [
47-
"pandas>=1.3.5,<3"
47+
"pandas>=2.0.3,<3"
4848
],
4949
"tests.entity.bounds": [
50-
"numpy"
50+
"numpy>=1.24.4,<2",
51+
"pandas>=2.0.3,<3"
5152
]
5253
},
5354
classifiers=[

test_requirements.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
flake8==6.1.0
1+
flake8==7.0.0
22
flake8-docstrings==1.7.0
3-
pytest==7.3.1
4-
pytest-cov==4.0.0
5-
pandas==1.5.0
6-
toolz==0.12.0
3+
pytest==8.0.0
4+
pytest-cov==4.1.0
5+
pandas>=2.0.3,<2.2.0
76
derp==0.1.1
8-
sphinx==5.0.0
9-
sphinx-rtd-theme==1.0.0
10-
sphinxcontrib-apidoc==0.3.0

tests/entity/bounds/test_categorical_bounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_numpy():
7070
np_copy = loads(dumps(np_bounds))
7171
assert np_copy == np_bounds
7272

73-
if len(array_like()) > 3: # Test numpy
73+
if len(array_like()) > 3: # Test pandas
7474
import pandas as pd
7575
pd_bounds = CategoricalBounds(pd.Series(["spam", "eggs"]))
7676
pd_copy = loads(dumps(pd_bounds))

tests/test_examples.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
"""Test of a complicated set of interlocking data objects."""
22
import json
33

4-
from gemd.entity.object.ingredient_run import IngredientRun
5-
from toolz import keymap, merge, keyfilter
6-
74
from gemd.json import dumps
85
from gemd.entity.attribute.condition import Condition
96
from gemd.entity.attribute.parameter import Parameter
107
from gemd.entity.attribute.property import Property
118
from gemd.entity.bounds.real_bounds import RealBounds
129
from gemd.entity.object import MeasurementRun, MaterialRun, ProcessRun, ProcessSpec,\
13-
MeasurementSpec, MaterialSpec
10+
MeasurementSpec, MaterialSpec, IngredientRun
1411
from gemd.entity.template.condition_template import ConditionTemplate
1512
from gemd.entity.template.material_template import MaterialTemplate
1613
from gemd.entity.template.measurement_template import MeasurementTemplate
@@ -45,13 +42,13 @@
4542

4643
def make_data_island(density, bulk_modulus, firing_temperature, binders, powders, tag=None):
4744
"""Helper function to create a relatively involved data island."""
48-
binder_specs = keymap(lambda x: MaterialSpec(name=x), binders)
49-
powder_specs = keymap(lambda x: MaterialSpec(name=x), powders)
45+
binder_specs = {MaterialSpec(name=k): v for k, v in binders.items()}
46+
powder_specs = {MaterialSpec(name=k): v for k, v in powders.items()}
5047

51-
binder_runs = keymap(lambda x: MaterialRun(name=x.name, spec=x), binder_specs)
52-
powder_runs = keymap(lambda x: MaterialRun(name=x.name, spec=x), powder_specs)
48+
binder_runs = {MaterialRun(name=k.name, spec=k): v for k, v in binder_specs.items()}
49+
powder_runs = {MaterialRun(name=k.name, spec=k): v for k, v in powder_specs.items()}
5350

54-
all_input_materials = keymap(lambda x: x.spec.name, merge(binder_runs, powder_runs))
51+
all_input_materials = {k.spec.name: v for k, v in binder_runs.items() | powder_runs.items()}
5552
mixing_composition = Condition(
5653
name="composition",
5754
value=NominalComposition(all_input_materials)
@@ -161,9 +158,7 @@ def test_access_data():
161158

162159
# read the quantity of alumina
163160
quantities = island.process.ingredients[0].material.process.conditions[0].value.quantities
164-
assert(list(
165-
keyfilter(lambda x: x == "Al2O3", quantities).values()
166-
)[0] == 0.96)
161+
assert quantities.get("Al2O3") == 0.96
167162

168163
# check that the serialization results in the correct number of objects in the preface
169164
# (note that neither measurements nor ingredients are serialized)

0 commit comments

Comments
 (0)