Skip to content

Commit bb71c0f

Browse files
authored
Merge pull request #925 from hackingmaterials/ml-evs/deps-tinkering
Reintroduce pandas pin and update tests
2 parents 36cbe8b + f5fb501 commit bb71c0f

File tree

14 files changed

+30
-25
lines changed

14 files changed

+30
-25
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Please submit help issues to:
2-
https://discuss.matsci.org/c/matminer/automatminer
2+
https://matsci.org/c/matminer/16
33

44
The Github issues is no longer used except for internal development purposes.
55

66
If you are unable to use the Discourse forum, you may submit an issue here, but you must **clearly** state the reason you are unable to use the Discourse forum in your ticket. Otherwise, your issue will be **closed** without response.
7+
8+
Please search both the forums and former GitHub issues before raising a ticket to avoid duplicating discussions.

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# The ext package is also only tested in this workflow. Coverage is also computed based on this platform.
44
name: Testing
55

6+
env:
7+
PYTEST_ADDOPTS: "--color=yes"
8+
69
on:
710
push:
811
branches:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ matminer is a library for performing data mining in the field of materials scien
77
- **[Help/Support Forum](https://matsci.org/c/matminer/16)**
88
- **[Source Repository](https://github.com/hackingmaterials/matminer)**
99

10-
matminer supports Python 3.8+.
10+
matminer supports Python 3.9+.
1111

1212
#### Related packages:
1313

docs_rst/installation.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
Installing matminer
88
===================
99

10-
Matminer requires Python 3.6+.
10+
Matminer requires Python 3.9+.
11+
12+
It is strongly recommend that you install it in a virtual environment (using e.g., conda, Python's venv, or related tools) to avoid conflicts with other packages.
1113

1214
There are a couple of quick and easy ways to install matminer (see also some **tips** below):
1315

@@ -28,6 +30,9 @@ or, to install matminer in your user home folder, run the command:
2830
2931
To update matminer, simply type ``pip install --upgrade matminer``.
3032

33+
This will install the latest version of all of matminer's dependencies.
34+
In cases of future incompatibility, you can install the specific versions used for testing matminer by following the development instructions below.
35+
3136
Install in development mode
3237
-----------------------------
3338

@@ -42,15 +47,16 @@ and then enter the cloned repository/folder to install in developer mode:
4247
.. code-block:: bash
4348
4449
$ cd matminer
45-
$ python setup.py develop
50+
$ pip install -r requirements/requirements-ubuntu_py3.11.txt # or corresponding file for your platform
51+
$ pip install -e .
4652
47-
To update matminer, enter your cloned folder and type ``git pull`` followed by ``python setup.py develop``.
53+
To update matminer, simply enter your cloned folder and type ``git pull``g
4854
4955
5056
Tips
5157
----
5258
53-
* Make sure you are using Python 3.6 or higher
59+
* Make sure you are using a compatible Python version (3.9+ at time of writing).
5460
* If you have trouble with the installation of a component library (sympy, pymatgen, mdf-forge, etc.), you can try to run ``pip install <<component>>`` or (if you are using `Anaconda <https://www.anaconda.com/distribution/>`_) ``conda install <<component>>`` first, and then re-try the installation.
5561

5662
- For example, installing pymatgen on a Windows platform is easiest with Anaconda via ``conda install -c conda-forge pymatgen``.

matminer/featurizers/composition/tests/test_alloy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_WenAlloys(self):
160160
"Shear modulus mean": 79.48600137832061,
161161
"Shear modulus strength model": -0.009636621848440554,
162162
"Total weight": 57.243028243301005,
163-
"VEC mean": 8.447250438374748,
163+
"VEC mean": 8.395723406331793,
164164
"Weight Fraction": "Fe0.6048579375087819 C0.00019995792415715736 "
165165
"Mn0.0005000210911858884 Si0.0005004488909678273 "
166166
"Cr9.991733798026916e-05 Ni0.19686472127404955 "

matminer/featurizers/site/external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def from_preset(cls, preset):
123123
"""
124124
valid_presets = ["formation_energy"]
125125
if preset == "formation_energy":
126-
return cls(6, 8, 8, 0.4, True, "gto", True)
126+
return cls(rcut=6, nmax=8, lmax=8, sigma=0.4, periodic=True, rbf="gto", crossover=True, compression=False)
127127
else:
128128
raise ValueError(f"'{preset}' is not a valid preset. Choose from {valid_presets}")
129129

matminer/featurizers/site/rdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def featurize(self, struct, idx):
428428
# Generate cos(theta) between neighbor pairs for each central site.
429429
# Also, retain data on neighbor distances for each pair
430430
# process with matrix algebra, we really need the speed here
431-
data = np.array(list(neighbor_tuples))
431+
data = np.array(list(neighbor_tuples), dtype=object)
432432
v1, v2 = np.vstack(data[:, 0, 0]), np.vstack(data[:, 1, 0])
433433
distances = data[:, :, 1]
434434
neighbor_pairs = np.concatenate(

matminer/featurizers/site/tests/test_rdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def test_grdf(self):
8686
[f"Gaussian center={i} width=1.0" for i in np.arange(10.0)],
8787
)
8888

89-
@unittest.skip("Test does not pass with latest deps")
9089
def test_afs(self):
9190
f1 = Gaussian(1, 0)
9291
f2 = Gaussian(1, 1)

matminer/featurizers/structure/bonding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def fit(self, X, y=None):
533533
"""
534534
unpadded_bobs = [self.bag(s, return_baglens=True) for s in X]
535535
bonds = [list(bob.keys()) for bob in unpadded_bobs]
536-
bonds = np.unique(sum(bonds, []))
536+
bonds = np.unique(np.array(sum(bonds, []), dtype=object))
537537
baglens = [0] * len(bonds)
538538

539539
for i, bond in enumerate(bonds):

matminer/featurizers/structure/tests/test_bonding.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def test_bondfractions(self):
6060
np.testing.assert_array_equal(df["Al - Al bond frac."].to_numpy(), [0.0, 0.0])
6161
np.testing.assert_array_equal(df["Ni - Ni bond frac."].to_numpy(), [0.0, 0.5])
6262

63-
@unittest.skip("Test does not pass with latest deps")
6463
def test_bob(self):
6564
# Test a single fit and featurization
6665
scm = SineCoulombMatrix(flatten=False)

matminer/featurizers/structure/tests/test_sites.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class StructureSitesFeaturesTest(StructureFeaturesTest):
14-
@unittest.skip("Test does not pass with latest deps")
1514
def test_sitestatsfingerprint(self):
1615
# Test matrix.
1716
op_struct_fp = SiteStatsFingerprint.from_preset("OPSiteFingerprint", stats=None)

matminer/featurizers/utils/grdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ def __call__(self, r_ij):
8888
return np.logical_and(
8989
np.greater_equal(r_ij, self.start),
9090
np.less(r_ij, self.start + self.width),
91-
dtype=np.float64,
9291
)
9392

9493
def volume(self, cutoff):

matminer/featurizers/utils/tests/test_grdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def test_gaussian(self):
3232
self.assertIn("width=4", name)
3333
self.assertIn("center=4", name)
3434

35-
@unittest.skip("Test does not pass with latest deps")
3635
def test_histogram(self):
3736
h = Histogram(1, 4)
3837
np.testing.assert_array_almost_equal([0, 1, 0], h([0.5, 2, 5]))

setup.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,15 @@ def local_version(version):
5454
include_package_data=True,
5555
zip_safe=False,
5656
install_requires=[
57-
"numpy>=1.20.1,<2",
58-
"requests",
59-
"pandas",
60-
"tqdm",
61-
"pymongo",
62-
"future",
63-
"scikit_learn",
64-
"sympy",
65-
"monty",
66-
"pymatgen",
57+
"numpy >= 1.23, < 2",
58+
"requests ~= 2.31",
59+
"pandas ~= 1.5",
60+
"tqdm ~= 4.66",
61+
"pymongo ~= 4.5",
62+
"scikit_learn ~= 1.3",
63+
"sympy ~= 1.11",
64+
"monty >= 2023",
65+
"pymatgen >= 2023",
6766
],
6867
extras_require=extras_require,
6968
classifiers=[

0 commit comments

Comments
 (0)