geometallurgy 0.4.3__tar.gz → 0.4.5__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 (45) hide show
  1. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/PKG-INFO +4 -4
  2. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/base.py +23 -1
  3. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/pyproject.toml +4 -4
  4. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/LICENSE +0 -0
  5. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/README.md +0 -0
  6. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/__init__.py +0 -0
  7. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/block_model.py +0 -0
  8. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/config/__init__.py +0 -0
  9. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/config/config_read.py +0 -0
  10. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/config/flowsheet_example.yaml +0 -0
  11. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/config/mc_config.yml +0 -0
  12. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/data/downloader.py +0 -0
  13. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/data/register.csv +0 -0
  14. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/datasets/__init__.py +0 -0
  15. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/datasets/datasets.py +0 -0
  16. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/datasets/downloader.py +0 -0
  17. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/datasets/register.csv +0 -0
  18. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/datasets/sample_data.py +0 -0
  19. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/extras.py +0 -0
  20. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/flowsheet/__init__.py +0 -0
  21. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/flowsheet/flowsheet.py +0 -0
  22. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/flowsheet/loader.py +0 -0
  23. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/flowsheet/operation.py +0 -0
  24. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/flowsheet/stream.py +0 -0
  25. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/interval_sample.py +0 -0
  26. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/io.py +0 -0
  27. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/plot.py +0 -0
  28. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/profile.py +0 -0
  29. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/sample.py +0 -0
  30. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/__init__.py +0 -0
  31. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/amenability.py +0 -0
  32. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/block_model_converter.py +0 -0
  33. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/components.py +0 -0
  34. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/data.py +0 -0
  35. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/interp.py +0 -0
  36. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/layout.py +0 -0
  37. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/moisture.py +0 -0
  38. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/pandas.py +0 -0
  39. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/parallel.py +0 -0
  40. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/partition.py +0 -0
  41. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/sampling.py +0 -0
  42. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/size.py +0 -0
  43. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/timer.py +0 -0
  44. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/utils/viz.py +0 -0
  45. {geometallurgy-0.4.3 → geometallurgy-0.4.5}/elphick/geomet/validate.py.hide +0 -0
@@ -1,26 +1,26 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geometallurgy
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Tools for the geometallurgist
5
5
  Home-page: https://github.com/elphick/geometallurgy
6
6
  Author: Greg
7
7
  Author-email: 11791585+elphick@users.noreply.github.com
8
- Requires-Python: >=3.9,<3.11
8
+ Requires-Python: >=3.9,<3.13
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
12
13
  Provides-Extra: all
13
14
  Provides-Extra: blockmodel
14
15
  Provides-Extra: map
15
16
  Provides-Extra: validation
16
17
  Requires-Dist: folium (>=0.16.0,<0.17.0) ; extra == "map"
17
- Requires-Dist: geoh5py (>=0.8.0,<0.9.0)
18
18
  Requires-Dist: omfvista (>=0.3.0) ; extra == "blockmodel"
19
19
  Requires-Dist: pandas (>=1.0)
20
20
  Requires-Dist: pandera[io] (>=0.19.3,<0.21.0) ; extra == "validation"
21
21
  Requires-Dist: periodictable (>=1.7.0,<2.0.0)
22
22
  Requires-Dist: plotly (>=5.22.0,<6.0.0)
23
- Requires-Dist: pyarrow (>=16.1.0,<17.0.0)
23
+ Requires-Dist: pyarrow (>=16.1.0,<18.0.0)
24
24
  Project-URL: Documentation, https://elphick.github.io/geometallurgy
25
25
  Project-URL: Repository, https://github.com/elphick/geometallurgy
26
26
  Description-Content-Type: text/markdown
@@ -213,6 +213,28 @@ class MassComposition(ABC):
213
213
  (self.mass_columns + [self.moisture_column] + self.composition_columns + self.supplementary_columns) if
214
214
  col is not None]
215
215
 
216
+ def balance_composition(self) -> MC:
217
+ """Balance the composition data
218
+
219
+ For records where the component mass exceeds the dry mass, the component masses are reduced proportionally
220
+ to equal the dry mass. Records where the component mass is less than the dry mass are left unchanged.
221
+
222
+ """
223
+ if self._mass_data is not None:
224
+ # calculate the ratio of the sum of the components to the dry mass
225
+ ratio = self._mass_data[self.composition_columns].sum(axis=1) / self._mass_data[self.mass_dry_var]
226
+ if ratio.max() <= 1.0:
227
+ return self
228
+ epsilon = 1e-6
229
+ # add a small value to the ratio to avoid component sums marginally over 100.0
230
+ ratio[ratio > 1.0] = ratio[ratio > 1.0] + epsilon
231
+ # to avoid reducing compliant records, clip the ratio at the lower side to 1.0
232
+ ratio = ratio.clip(lower=1.0)
233
+ # apply the ratio to the components
234
+ self._mass_data[self.composition_columns] = self._mass_data[self.composition_columns].div(ratio, axis=0)
235
+
236
+ return self
237
+
216
238
  def plot_parallel(self, color: Optional[str] = None,
217
239
  vars_include: Optional[list[str]] = None,
218
240
  vars_exclude: Optional[list[str]] = None,
@@ -696,7 +718,7 @@ class MassComposition(ABC):
696
718
  moisture_column_name: Optional[str] = None,
697
719
  component_columns: Optional[list[str]] = None,
698
720
  composition_units: Literal['%', 'ppm', 'ppb'] = '%',
699
- **kwargs):
721
+ **kwargs) -> MC:
700
722
  """
701
723
  Class method to create a MassComposition object from a mass dataframe.
702
724
 
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "geometallurgy"
3
3
  packages = [{ include = "elphick/geomet" }]
4
- version = "0.4.3"
4
+ version = "0.4.5"
5
5
  description = "Tools for the geometallurgist"
6
6
  authors = ["Greg <11791585+elphick@users.noreply.github.com>"]
7
7
  repository = "https://github.com/elphick/geometallurgy"
@@ -31,12 +31,12 @@ name = "Other Tasks"
31
31
  showcontent = true
32
32
 
33
33
  [tool.poetry.dependencies]
34
- python = ">=3.9,<3.11"
34
+ python = ">=3.9,<3.13"
35
35
  plotly = "^5.22.0"
36
36
  pandas = ">=1.0"
37
37
  periodictable = "^1.7.0"
38
- geoh5py = "^0.8.0"
39
- pyarrow = "^16.1.0"
38
+ #geoh5py = ">=0.8.0,<10.0.0"
39
+ pyarrow = ">=16.1.0,<18.0.0"
40
40
  folium = { version = "^0.16.0", optional = true }
41
41
  pandera = { version = ">=0.19.3,<0.21.0", extras = ['io'], optional = true }
42
42
  omfvista = { version = ">=0.3.0", optional = true }
File without changes
File without changes