Skip to content

Commit

Permalink
install at test time
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathf committed Nov 4, 2024
1 parent f5ddfad commit 4f2ee36
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 54 deletions.
56 changes: 24 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,41 @@ jobs:
password: $DOCKERHUB_PASSWORD
steps:
- checkout
# - restore_cache:
# keys:
# - py310-{{ checksum "requirements-dev.txt"}}
# - py310-
- restore_cache:
keys:
- py310-{{ checksum "requirements-dev.txt"}}
- py310-
- run:
name: "Installation"
command: |
python3 -m venv venv
source venv/bin/activate
pip install -U pip build
pip install -r requirements-dev.txt
pip install .[dev]
python -m build
pip install dist/*.whl
# - save_cache:
# key: py310-{{ checksum "requirements-dev.txt"}}
# paths:
# - venv
pip install -e .[dev]
- save_cache:
key: py310-{{ checksum "requirements-dev.txt"}}
paths:
- venv
- run:
name: "Run pytest"
command: |
source venv/bin/activate
pytest --doctest-modules numpoly/ test/
# - run:
# name: "Run pylint"
# command: |
# source venv/bin/activate
# pylint --rcfile=.pylintrc -E numpoly
# - run:
# name: "Run pydocstyle"
# command: |
# source venv/bin/activate
# pydocstyle --ignore=D202,D203,D212 numpoly
# - run:
# name: "Run black"
# command: |
# source venv/bin/activate
# black --check numpoly
# - run:
# name: "Run Sphinx build"
# command: |
# source venv/bin/activate
# sphinx-build docs/ docs/.build -b html -v --color -T -W --keep-going
- run:
name: "Run pydocstyle"
command: |
source venv/bin/activate
pydocstyle --ignore=D202,D203,D212 numpoly
- run:
name: "Run black"
command: |
source venv/bin/activate
black --check numpoly
- run:
name: "Run Sphinx build"
command: |
source venv/bin/activate
sphinx-build docs/ docs/.build -b html -v --color -T -W --keep-going
deploy:
docker:
- image: circleci/python:3.10.1
Expand Down
38 changes: 19 additions & 19 deletions numpoly/array_function/multiply.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,24 @@ def multiply(
else out
)

# seen = set()
# for expon1, coeff1 in zip(x1.exponents, x1.coefficients):
# for expon2, coeff2 in zip(x2.exponents, x2.coefficients):
# key = (expon1 + expon2 + x1.KEY_OFFSET).ravel()
# key = key.view(f"U{len(expon1)}").item()
# if key in seen:
# out_.values[key] += numpy.multiply(
# coeff1, coeff2, where=where, **kwargs
# )
# else:
# numpy.multiply(
# coeff1, coeff2, out=out_.values[key], where=where, **kwargs
# )
# seen.add(key)
#
# if out is None:
# out_ = numpoly.clean_attributes(out_)
# seen = set()
# for expon1, coeff1 in zip(x1.exponents, x1.coefficients):
# for expon2, coeff2 in zip(x2.exponents, x2.coefficients):
# key = (expon1 + expon2 + x1.KEY_OFFSET).ravel()
# key = key.view(f"U{len(expon1)}").item()
# if key in seen:
# out_.values[key] += numpy.multiply(
# coeff1, coeff2, where=where, **kwargs
# )
# else:
# numpy.multiply(
# coeff1, coeff2, out=out_.values[key], where=where, **kwargs
# )
# seen.add(key)
#
# if out is None:
# out_ = numpoly.clean_attributes(out_)

numpoly.cmultiply(
x1.exponents,
x2.exponents,
Expand All @@ -106,5 +106,5 @@ def multiply(
)
if out is None:
out_ = numpoly.clean_attributes(out_)

return out_
3 changes: 2 additions & 1 deletion numpoly/array_function/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

@implements(numpy.reshape)
def reshape(
a: PolyLike, /,
a: PolyLike,
/,
shape: Union[int, Sequence[int]] = None,
order: Order = "C",
newshape: Union[int, Sequence[int]] = None,
Expand Down
2 changes: 1 addition & 1 deletion numpoly/construct/from_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def polynomial_from_attributes(
if coefficients:
numpoly.cfrom_attributes(coefficients, poly.values.ravel())

#for key, values in zip(poly.keys, coefficients):
# for key, values in zip(poly.keys, coefficients):
# poly.values[key] = values

return poly
2 changes: 1 addition & 1 deletion numpoly/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def simple_dispatch(

for key in keys[1:]:
out_.values[key] = numpy_func(*[poly.values[key] for poly in inputs], **kwargs)
#numpoly.cloop_function(numpy_func, list(inputs), keys, out_.values, **kwargs)
# numpoly.cloop_function(numpy_func, list(inputs), keys, out_.values, **kwargs)

if out is None:
out_ = numpoly.clean_attributes(out_)
Expand Down

0 comments on commit 4f2ee36

Please sign in to comment.