Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
all:

upload:
rm -r dist
python setup.py sdist
twine upload dist/*
uv publish

test:
# For some reason the import changes for Python 3 caused the Python 2 test
# loader to give up without loading any tests. So we discover them ourselves.
# python -m unittest
find chumpy -name 'test_*.py' | sed -e 's/\.py$$//' -e 's/\//./' | xargs python -m unittest
uv run python -m unittest

coverage: clean qcov
qcov: all
env LD_PRELOAD=$(PRELOADED) coverage run --source=. -m unittest discover -s .
coverage html
coverage report -m
uv run coverage run -m unittest
uv run coverage html
uv run coverage report -m
4 changes: 2 additions & 2 deletions chumpy/api_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from . import ch
import numpy as np
from os.path import join, split
from six import StringIO
from io import StringIO
import numpy
import chumpy
from six.moves import cPickle as pickle
import pickle

src = ''
num_passed = 0
Expand Down
6 changes: 3 additions & 3 deletions chumpy/ch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ def string_for(self, my_name):
result += string_for(getattr(self, dterm), dterm)

if cachelim != np.inf and hasattr(self, '_cache') and 'drs' in self._cache:
from six.moves import cPickle as pickle
import pickle
for dtval, jac in list(self._cache['drs'].items()):
# child_label = getattr(dtval, 'label') if hasattr(dtval, 'label') else dterm
# child_label = '%s (%s)' % (child_label, str(dtval.__class__.__name__))
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def depends_on(*dependencies):
[deps.add(d) for d in dep]

def _depends_on(func):
want_out = 'out' in inspect.getargspec(func).args
want_out = 'out' in inspect.getfullargspec(func).args

@wraps(func)
def with_caching(self, *args, **kwargs):
Expand Down Expand Up @@ -1243,7 +1243,7 @@ def on_changed(self, which):
self.args[argname].x = getattr(self, argname)

def __init__(self, lmb, initial_args=None):
args = {argname: ChHandle(x=Ch(idx)) for idx, argname in enumerate(inspect.getargspec(lmb)[0])}
args = {argname: ChHandle(x=Ch(idx)) for idx, argname in enumerate(inspect.getfullargspec(lmb)[0])}
if initial_args is not None:
for initial_arg in initial_args:
if initial_arg in args:
Expand Down
5 changes: 2 additions & 3 deletions chumpy/ch_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@


from .ch import Ch
import six
import numpy as np
import warnings
from six.moves import cPickle as pickle
import pickle
import scipy.sparse as sp
from .utils import row, col
from copy import copy as copy_copy
Expand Down Expand Up @@ -82,7 +81,7 @@ class WontImplement(Exception):

def asarray(a, dtype=None, order=None):
assert(dtype is None or dtype is np.float64)
assert(order is 'C' or order is None)
assert(order == 'C' or order is None)
if hasattr(a, 'dterms'):
return a
return Ch(np.asarray(a, dtype, order))
Expand Down
2 changes: 1 addition & 1 deletion chumpy/test_ch.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_serialization(self):
# attribute, which is a nonserializable WeakKeyDictionary.
# So we pickle/unpickle, change a child and verify the value
# at root, and verify that both children have parentage.
from six.moves import cPickle as pickle
import pickle
tmp = ch.Ch(10) + ch.Ch(20)
tmp = pickle.loads(pickle.dumps(tmp))
tmp.b.x = 30
Expand Down
4 changes: 3 additions & 1 deletion chumpy/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version = '0.71'
import importlib.metadata

version = importlib.metadata.version("chumpy")
short_version = version
full_version = version
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

[dependency-groups]
dev = [
"coverage>=7.8.0"
]

[project]
authors = [
{email = "[email protected]", name = "Matthew Loper"}
]
classifiers = [
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Science/Research',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Mathematics'
]
dependencies = [
"scipy>=1.13.1"
]
description = "Autodifferentiation tool for Python"
license = "MIT"
name = "chumpy"
readme = "README.md"
requires-python = ">=3.9"
version = "0.71"

[project.urls]
Repository = 'https://github.com/mattloper/chumpy'

[tool.hatch.build]
exclude = ["chumpy/optional_test_performance.py"]
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

59 changes: 0 additions & 59 deletions setup.py

This file was deleted.

Loading