Skip to content

Commit d404465

Browse files
committed
Update requirements, minor fixes
* Minor differences in ITIM results due to changes in depedencies * Version bump
1 parent 38acc8d commit d404465

File tree

9 files changed

+27
-29
lines changed

9 files changed

+27
-29
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# The executor is the environment in which the steps below will be executed - below will use a python 3.8 container
2222
# Change the version below to your required version of python
2323
docker:
24-
- image: cimg/python:3.8
24+
- image: cimg/python:3.9
2525
# Checkout the code as the first step. This is a dedicated CircleCI step.
2626
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
2727
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
@@ -35,10 +35,10 @@ jobs:
3535
# pip-dependency-file: test-requirements.txt # if you have a different name for your requirements file, maybe one that combines your runtime and test requirements.
3636
- run:
3737
name: Install pytim
38-
command: pip install -r requirements.txt -r requirements.testing.txt -e .
38+
command: pip install --upgrade -r requirements.txt -r requirements.testing.txt -e .
3939
- run:
4040
name: Run tests
41-
command: python setup.py test
41+
command: pytest pytim/*py pytim/observables/*py pytim/datafiles/*py --doctest-modules
4242
# - run:
4343
#name: Coverage
4444
# # This assumes pytest is installed via the install-package step above

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.11"]
15+
python-version: ["3.9", "3.11"]
1616
include:
1717
- python-version: "3.9"
1818
numpy-version: "1.26.4"
@@ -31,7 +31,7 @@ jobs:
3131
python -m pip install flake8 pytest
3232
python -m pip install mdtraj
3333
python -m pip install .
34-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34+
if [ -f requirements.txt ]; then pip install --upgrade -r requirements.txt; fi
3535
#- name: Lint with flake8
3636
# run: |
3737
# # stop the build if there are Python syntax errors or undefined names
@@ -40,5 +40,5 @@ jobs:
4040
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4141
- name: Test with pytest
4242
run: |
43-
pytest pytim/*py pytim/observables/*py pytim/datafiles/*py --doctest-modules
43+
pytest pytim/ --doctest-modules
4444

pytim/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _define_cluster_group(self):
190190
labels = np.array(labels)
191191

192192
# counts is not necessarily ordered by size of cluster.
193-
sorting = np.argsort(counts)[::-1]
193+
sorting = np.argsort(counts,kind='stable')[::-1]
194194
# labels for atoms in each cluster starting from the largest
195195
unique_labels = np.sort(np.unique(labels[labels > -1]))
196196
# by default, all elements of the cluster_group are in

pytim/itim.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ class ITIM(Interface):
8585
>>> print (interface.layers)
8686
[[<AtomGroup with 786 atoms> <AtomGroup with 681 atoms>
8787
<AtomGroup with 663 atoms> <AtomGroup with 651 atoms>]
88-
[<AtomGroup with 786 atoms> <AtomGroup with 702 atoms>
89-
<AtomGroup with 666 atoms> <AtomGroup with 636 atoms>]]
88+
[<AtomGroup with 786 atoms> <AtomGroup with 699 atoms>
89+
<AtomGroup with 669 atoms> <AtomGroup with 636 atoms>]]
9090
9191
9292
>>> interface.layers[0,0] # upper side, first layer
9393
<AtomGroup with 786 atoms>
9494
9595
>>> interface.layers[1,2] # lower side, third layer
96-
<AtomGroup with 666 atoms>
96+
<AtomGroup with 669 atoms>
9797
9898
>>> # or as a whole AtomGroup. This can include all atoms in all layers
9999
>>> interface.atoms
@@ -170,12 +170,12 @@ def layers(self):
170170
>>> print(interface.layers[:,0:3]) # 1st - 3rd layer (0:3), on both sides
171171
[[<AtomGroup with 786 atoms> <AtomGroup with 681 atoms>
172172
<AtomGroup with 663 atoms>]
173-
[<AtomGroup with 786 atoms> <AtomGroup with 702 atoms>
174-
<AtomGroup with 666 atoms>]]
173+
[<AtomGroup with 786 atoms> <AtomGroup with 699 atoms>
174+
<AtomGroup with 669 atoms>]]
175175
176176
177177
>>> print(interface.layers[1,0:4:2]) # side 1, layers 1-4 & stride 2 (0:4:2)
178-
[<AtomGroup with 786 atoms> <AtomGroup with 666 atoms>]
178+
[<AtomGroup with 786 atoms> <AtomGroup with 669 atoms>]
179179
180180
"""
181181

@@ -380,7 +380,7 @@ def _assign_layers(self):
380380
_y = utilities.get_y(self.cluster_group, self.normal)
381381
_z = utilities.get_z(self.cluster_group, self.normal)
382382

383-
sort = np.argsort(_z + _radius * np.sign(_z))
383+
sort = np.argsort(_z + _radius * np.sign(_z),kind='stable')
384384
# NOTE: np.argsort returns the sorted *indices*
385385

386386
if self.multiproc and ('win' not in self.system.lower()):

pytim/observables/contactangle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def _fit_ellipse_fitzgibbon(x, y):
496496
C = np.zeros((6, 6), dtype=float)
497497
C[0, 2], C[2, 0], C[1, 1] = 2, 2, -1
498498
eigval, eigvec = np.linalg.eig(np.linalg.solve(S, C))
499-
sort = np.argsort(eigval)
499+
sort = np.argsort(eigval,kind='stable')
500500
eigval, eigvec = eigval[sort], eigvec[sort]
501501
lam = np.nonzero(np.logical_and(
502502
eigval > 0, np.isfinite(eigval)))[0][-1]
@@ -515,7 +515,7 @@ def _fit_ellipse_flusser(x, y):
515515
C = np.array(((0, 0, 2), (0, -1, 0), (2, 0, 0)), dtype=float)
516516
M = np.linalg.solve(C, M)
517517
eigval, eigvec = np.linalg.eig(M)
518-
sort = np.argsort(eigval)[::-1]
518+
sort = np.argsort(eigval,kind='stable')[::-1]
519519
eigval, eigvec = eigval[sort], eigvec[sort]
520520
con = 4 * eigvec[0] * eigvec[2] - eigvec[1]**2 > 0
521521
ak = eigvec[:, np.nonzero(con)[0]]

pytim/utilities.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,15 @@ def correlate(a1, a2=None, _normalize=True):
7272
... size.append(len(inter.layers[0,0]))
7373
>>>
7474
>>> # we need to subtract the average value
75-
>>> np.set_printoptions(precision=3,threshold=1000)
75+
>>> np.set_printoptions(precision=3,threshold=1000,suppress=True)
7676
>>> corr = pytim.utilities.correlate(size-np.mean(size))
7777
>>> corr = corr/corr[0] # normalize to 1
7878
>>> print (corr)
79-
[ 1. 0.142 0.104 0.147 0.371 0.099 0.165 0.095 0.338 0.219
80-
-0.021 0.087 0.245 -0.01 -0.193 0.103 0.029 -0.009 -0.11 0.012
81-
-0.133 0.056 -0.283 -0.276 0.035 -0.012 -0.211 -0.429 -0.132 -0.263
82-
0.072 -0.7 -0.236 0.136 -0.243 -0.878 -0.13 -0.329 -0.386 -0.652
83-
-0.267 -0.188 -0.226 -0.79 -0.284 -0.02 -1.512 -1.316 -0.188 7.551]
84-
85-
>>> np.set_printoptions()
79+
[ 1. 0.153 0.104 0.17 0.365 0.115 0.171 0.104 0.342 0.24
80+
-0.021 0.097 0.265 0.004 -0.169 0.088 0.022 -0.008 -0.113 0.003
81+
-0.139 0.051 -0.287 -0.279 0.027 -0.019 -0.223 -0.43 -0.157 -0.285
82+
0.048 -0.704 -0.26 0.13 -0.31 -0.883 -0.12 -0.323 -0.388 -0.64
83+
-0.295 -0.177 -0.165 -0.81 -0.321 -0.031 -1.557 -1.296 -0.305 6.974]
8684
8785
This will produce (sampling the whole trajectory), the following:
8886

pytim/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.0.0'
1+
__version__ = '1.0.1'

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cython>=0.24.1
2-
numpy>=1.16.0
2+
numpy>=1.26.4,<2.0.0
33
scipy>=1.6.0
4-
gsd<=3.2.1
5-
MDAnalysis>=2.0
4+
gsd>3.0.0
5+
MDAnalysis>=2.7.0
66
PyWavelets>=0.5.2
77
scikit-image>=0.14.2
88
sphinx>=1.4.3

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def run_tests(self):
125125
# requirements files see:
126126
# https://packaging.python.org/en/latest/requirements.html
127127
install_requires=[
128-
'numpy>=1.16', 'cython>=0.24.1','gsd<=3.2.1'
128+
'numpy>=1.26.4,<2.0.0', 'cython>=0.24.1','gsd>=3.0.0','MDAnalysis>=2.7.0'
129129
],
130130

131131
# List additional groups of dependencies here (e.g. development

0 commit comments

Comments
 (0)