metatensor-learn 0.6.2__tar.gz → 0.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {metatensor_learn-0.6.2/metatensor_learn.egg-info → metatensor_learn-0.6.3}/PKG-INFO +4 -4
  2. metatensor_learn-0.6.3/git_version_info +2 -0
  3. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_equivariant.py +8 -20
  4. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_module.py +9 -4
  5. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_module_map.py +10 -20
  6. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3/metatensor_learn.egg-info}/PKG-INFO +4 -4
  7. metatensor_learn-0.6.3/metatensor_learn.egg-info/requires.txt +2 -0
  8. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/pyproject.toml +1 -1
  9. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/setup.py +3 -3
  10. metatensor_learn-0.6.2/git_version_info +0 -2
  11. metatensor_learn-0.6.2/metatensor_learn.egg-info/requires.txt +0 -2
  12. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/AUTHORS +0 -0
  13. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/LICENSE +0 -0
  14. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/MANIFEST.in +0 -0
  15. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/README.rst +0 -0
  16. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/__init__.py +0 -0
  17. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/_backend.py +0 -0
  18. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/_dispatch.py +0 -0
  19. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/data/__init__.py +0 -0
  20. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/data/_collate.py +0 -0
  21. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/data/_dataloader.py +0 -0
  22. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/data/_dataset.py +0 -0
  23. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/data/_namedtuple.py +0 -0
  24. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/__init__.py +0 -0
  25. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_layer_norm.py +0 -0
  26. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_linear.py +0 -0
  27. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_relu.py +0 -0
  28. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_sequential.py +0 -0
  29. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_silu.py +0 -0
  30. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_tanh.py +0 -0
  31. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn/nn/_utils.py +0 -0
  32. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn.egg-info/SOURCES.txt +0 -0
  33. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn.egg-info/dependency_links.txt +0 -0
  34. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn.egg-info/top_level.txt +0 -0
  35. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/metatensor_learn.egg-info/zip-safe +0 -0
  36. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/setup.cfg +0 -0
  37. {metatensor_learn-0.6.2 → metatensor_learn-0.6.3}/tests/test_dummy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metatensor-learn
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Building blocks for the atomistic machine learning models based on PyTorch and NumPy
5
5
  Author: Guillaume Fraux, Rohit Goswami, Philip Loche, Filippo Bigi, Joseph W. Abbott, Davide Tisi, Alexander Goscinski, Michele Ceriotti
6
6
  License-Expression: BSD-3-Clause
@@ -22,12 +22,12 @@ Classifier: Topic :: Scientific/Engineering :: Chemistry
22
22
  Classifier: Topic :: Scientific/Engineering :: Physics
23
23
  Classifier: Topic :: Software Development :: Libraries
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
- Requires-Python: >=3.10
25
+ Requires-Python: >=3.11
26
26
  Description-Content-Type: text/x-rst
27
27
  License-File: LICENSE
28
28
  License-File: AUTHORS
29
- Requires-Dist: metatensor-operations<0.6,>=0.5.0
30
- Requires-Dist: metatensor-core<0.3,>=0.2.1
29
+ Requires-Dist: metatensor-operations<0.6,>=0.5.1
30
+ Requires-Dist: metatensor-core<0.3,>=0.2.7
31
31
  Dynamic: author
32
32
  Dynamic: license-file
33
33
  Dynamic: requires-dist
@@ -0,0 +1,2 @@
1
+ 0
2
+ git.1b81e20
@@ -47,15 +47,10 @@ class EquivariantTransformation(Module):
47
47
  ... values=torch.randn(2, 1, 3),
48
48
  ... samples=Labels(
49
49
  ... ["system", "atom"],
50
- ... np.array(
51
- ... [
52
- ... [0, 0],
53
- ... [0, 1],
54
- ... ]
55
- ... ),
50
+ ... torch.tensor([[0, 0], [0, 1]]),
56
51
  ... ),
57
- ... components=[Labels(["o3_mu"], np.array([[0]]))],
58
- ... properties=Labels(["properties"], np.array([[0], [1], [2]])),
52
+ ... components=[Labels(["o3_mu"], torch.tensor([[0]]))],
53
+ ... properties=Labels(["properties"], torch.tensor([[0], [1], [2]])),
59
54
  ... )
60
55
 
61
56
  Define a dummy covariant TensorBlock
@@ -64,20 +59,15 @@ class EquivariantTransformation(Module):
64
59
  ... values=torch.randn(2, 3, 3),
65
60
  ... samples=Labels(
66
61
  ... ["system", "atom"],
67
- ... np.array(
68
- ... [
69
- ... [0, 0],
70
- ... [0, 1],
71
- ... ]
72
- ... ),
62
+ ... torch.tensor([[0, 0], [0, 1]]),
73
63
  ... ),
74
- ... components=[Labels(["o3_mu"], np.array([[-1], [0], [1]]))],
75
- ... properties=Labels(["properties"], np.array([[3], [4], [5]])),
64
+ ... components=[Labels(["o3_mu"], torch.tensor([[-1], [0], [1]]))],
65
+ ... properties=Labels(["properties"], torch.tensor([[3], [4], [5]])),
76
66
  ... )
77
67
 
78
68
  Create a TensorMap containing the dummy TensorBlocks
79
69
 
80
- >>> keys = Labels(names=["o3_lambda"], values=np.array([[0], [1]]))
70
+ >>> keys = Labels(names=["o3_lambda"], values=torch.tensor([[0], [1]]))
81
71
  >>> tensor = TensorMap(keys, [block_1, block_2])
82
72
 
83
73
  Define the transformation to apply to the TensorMap
@@ -92,9 +82,7 @@ class EquivariantTransformation(Module):
92
82
  ... tensor.keys,
93
83
  ... in_features,
94
84
  ... out_properties=[tensor.block(key).properties for key in tensor.keys],
95
- ... invariant_keys=Labels(
96
- ... ["o3_lambda"], np.array([0], dtype=np.int64).reshape(-1, 1)
97
- ... ),
85
+ ... invariant_keys=Labels(["o3_lambda"], torch.tensor([[0]])),
98
86
  ... )
99
87
 
100
88
  The output metadata are the same as the input
@@ -83,12 +83,17 @@ class Module(torch.nn.Module):
83
83
  _mts_buffer_names: List[str]
84
84
  _mts_non_persistent_buffers: List[str]
85
85
 
86
- def __init__(self):
87
- """"""
86
+ def __init__(self, device=None, dtype=None):
87
+ """
88
+ :param device: The device all data in this module is stored on, defaults to CPU
89
+ :param dtype: The data type to use for floating point values, defaults to
90
+ torch's global default.
91
+ """
88
92
  super().__init__()
89
93
  self._mts_buffer_names = []
90
94
  self._mts_non_persistent_buffers = []
91
95
  self.register_buffer("_mts_helper", torch.zeros(0))
96
+ self.to(dtype=dtype, device=device)
92
97
 
93
98
  def __setattr__(self, name, value):
94
99
  if isinstance(value, Buffer):
@@ -461,7 +466,7 @@ def _deserialize_metatensor(value):
461
466
  block = block.to(
462
467
  dtype=dtype_device_tensor.dtype,
463
468
  device=dtype_device_tensor.device,
464
- arrays="torch",
469
+ array_backend="torch",
465
470
  )
466
471
  return block, True
467
472
 
@@ -470,7 +475,7 @@ def _deserialize_metatensor(value):
470
475
  tensor = tensor.to(
471
476
  dtype=dtype_device_tensor.dtype,
472
477
  device=dtype_device_tensor.device,
473
- arrays="torch",
478
+ array_backend="torch",
474
479
  )
475
480
  return tensor, True
476
481
 
@@ -67,15 +67,10 @@ class ModuleMap(Module):
67
67
  ... ),
68
68
  ... samples=Labels(
69
69
  ... ["system", "atom"],
70
- ... np.array(
71
- ... [
72
- ... [0, 0],
73
- ... [0, 1],
74
- ... ]
75
- ... ),
70
+ ... torch.tensor([[0, 0], [0, 1]]),
76
71
  ... ),
77
72
  ... components=[],
78
- ... properties=Labels(["properties"], np.array([[0], [1], [2]])),
73
+ ... properties=Labels(["properties"], torch.tensor([[0], [1], [2]])),
79
74
  ... )
80
75
  >>> block_2 = TensorBlock(
81
76
  ... values=torch.tensor(
@@ -86,17 +81,12 @@ class ModuleMap(Module):
86
81
  ... ),
87
82
  ... samples=Labels(
88
83
  ... ["system", "atom"],
89
- ... np.array(
90
- ... [
91
- ... [0, 0],
92
- ... [0, 1],
93
- ... ]
94
- ... ),
84
+ ... torch.tensor([[0, 0], [0, 1]]),
95
85
  ... ),
96
86
  ... components=[],
97
- ... properties=Labels(["properties"], np.array([[3], [4], [5]])),
87
+ ... properties=Labels(["properties"], torch.tensor([[3], [4], [5]])),
98
88
  ... )
99
- >>> keys = Labels(names=["key"], values=np.array([[0], [1]]))
89
+ >>> keys = Labels(names=["key"], values=torch.tensor([[0], [1]]))
100
90
  >>> tensor = TensorMap(keys, [block_1, block_2])
101
91
 
102
92
  Create modules
@@ -196,9 +186,9 @@ class ModuleMap(Module):
196
186
  ... [3.0, 5.0, 6.0],
197
187
  ... ]
198
188
  ... ),
199
- ... samples=Labels(["system", "atom"], np.array([[0, 0], [0, 1]])),
189
+ ... samples=Labels(["system", "atom"], torch.tensor([[0, 0], [0, 1]])),
200
190
  ... components=[],
201
- ... properties=Labels(["properties"], np.array([[0], [1], [2]])),
191
+ ... properties=Labels(["properties"], torch.tensor([[0], [1], [2]])),
202
192
  ... )
203
193
  >>> block_2 = TensorBlock(
204
194
  ... values=torch.tensor(
@@ -207,11 +197,11 @@ class ModuleMap(Module):
207
197
  ... [1.0, 2.0, 8.0],
208
198
  ... ]
209
199
  ... ),
210
- ... samples=Labels(["system", "atom"], np.array([[0, 0], [0, 1]])),
200
+ ... samples=Labels(["system", "atom"], torch.tensor([[0, 0], [0, 1]])),
211
201
  ... components=[],
212
- ... properties=Labels(["properties"], np.array([[0], [1], [2]])),
202
+ ... properties=Labels(["properties"], torch.tensor([[0], [1], [2]])),
213
203
  ... )
214
- >>> keys = Labels(names=["key"], values=np.array([[0], [1]]))
204
+ >>> keys = Labels(names=["key"], values=torch.tensor([[0], [1]]))
215
205
  >>> tensor = TensorMap(keys, [block_1, block_2])
216
206
  >>> linear = torch.nn.Linear(3, 1, bias=False)
217
207
  >>> with torch.no_grad():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metatensor-learn
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Building blocks for the atomistic machine learning models based on PyTorch and NumPy
5
5
  Author: Guillaume Fraux, Rohit Goswami, Philip Loche, Filippo Bigi, Joseph W. Abbott, Davide Tisi, Alexander Goscinski, Michele Ceriotti
6
6
  License-Expression: BSD-3-Clause
@@ -22,12 +22,12 @@ Classifier: Topic :: Scientific/Engineering :: Chemistry
22
22
  Classifier: Topic :: Scientific/Engineering :: Physics
23
23
  Classifier: Topic :: Software Development :: Libraries
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
- Requires-Python: >=3.10
25
+ Requires-Python: >=3.11
26
26
  Description-Content-Type: text/x-rst
27
27
  License-File: LICENSE
28
28
  License-File: AUTHORS
29
- Requires-Dist: metatensor-operations<0.6,>=0.5.0
30
- Requires-Dist: metatensor-core<0.3,>=0.2.1
29
+ Requires-Dist: metatensor-operations<0.6,>=0.5.1
30
+ Requires-Dist: metatensor-core<0.3,>=0.2.7
31
31
  Dynamic: author
32
32
  Dynamic: license-file
33
33
  Dynamic: requires-dist
@@ -0,0 +1,2 @@
1
+ metatensor-operations<0.6,>=0.5.1
2
+ metatensor-core<0.3,>=0.2.7
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "metatensor-learn"
3
3
  dynamic = ["version", "authors", "dependencies"]
4
- requires-python = ">=3.10"
4
+ requires-python = ">=3.11"
5
5
 
6
6
  readme = "README.rst"
7
7
  license = "BSD-3-Clause"
@@ -13,7 +13,7 @@ ROOT = pathlib.Path(__file__).parent.resolve()
13
13
  METATENSOR_CORE = (ROOT / ".." / "metatensor_core").resolve()
14
14
  METATENSOR_OPERATIONS = (ROOT / ".." / "metatensor_operations").resolve()
15
15
 
16
- METATENSOR_LEARN_VERSION = "0.6.2"
16
+ METATENSOR_LEARN_VERSION = "0.6.3"
17
17
 
18
18
 
19
19
  class bdist_egg_disabled(bdist_egg):
@@ -141,8 +141,8 @@ if __name__ == "__main__":
141
141
  install_requires.append(f"metatensor-core @ {METATENSOR_CORE.as_uri()}")
142
142
  else:
143
143
  # we are building from a sdist/installing from a wheel
144
- install_requires.append("metatensor-operations >=0.5.0,<0.6")
145
- install_requires.append("metatensor-core >=0.2.1,<0.3")
144
+ install_requires.append("metatensor-operations >=0.5.1,<0.6")
145
+ install_requires.append("metatensor-core >=0.2.7,<0.3")
146
146
 
147
147
  setup(
148
148
  version=create_version_number(METATENSOR_LEARN_VERSION),
@@ -1,2 +0,0 @@
1
- 0
2
- git.9dfa936
@@ -1,2 +0,0 @@
1
- metatensor-operations<0.6,>=0.5.0
2
- metatensor-core<0.3,>=0.2.1