geometallurgy 0.4.16__tar.gz → 0.4.18__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.
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/PKG-INFO +3 -3
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/mc_config.yml +4 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/flowsheet/operation.py +14 -2
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/pyproject.toml +5 -4
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/LICENSE +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/README.md +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/__init__.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/base.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/block_model.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/__init__.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/config_read.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/flowsheet_example_partition.yaml +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/flowsheet_example_simple.yaml +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/data/downloader.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/data/register.csv +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/datasets/__init__.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/datasets/datasets.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/datasets/downloader.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/datasets/register.csv +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/datasets/sample_data.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/extras.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/flowsheet/__init__.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/flowsheet/flowsheet.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/flowsheet/loader.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/flowsheet/stream.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/interval_sample.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/io.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/plot.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/profile.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/sample.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/__init__.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/amenability.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/block_model_converter.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/components.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/data.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/estimates.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/interp.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/interp2.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/layout.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/moisture.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/pandas.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/parallel.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/partition.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/size.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/timer.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/utils/viz.py +0 -0
- {geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/validate.py.hide +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: geometallurgy
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.18
|
|
4
4
|
Summary: Tools for the geometallurgist
|
|
5
5
|
Home-page: https://github.com/elphick/geometallurgy
|
|
6
6
|
Author: Greg
|
|
@@ -14,13 +14,13 @@ Provides-Extra: blockmodel
|
|
|
14
14
|
Provides-Extra: spatial
|
|
15
15
|
Provides-Extra: validation
|
|
16
16
|
Requires-Dist: folium (>=0.16.0,<0.17.0) ; extra == "spatial"
|
|
17
|
-
Requires-Dist: omfpandas (>=0.
|
|
17
|
+
Requires-Dist: omfpandas (>=0.9.3) ; extra == "blockmodel"
|
|
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
|
|
23
|
+
Requires-Dist: pyarrow (>=16.1.0)
|
|
24
24
|
Requires-Dist: rioxarray (>=0.18.2,<0.19.0) ; extra == "spatial"
|
|
25
25
|
Project-URL: Documentation, https://elphick.github.io/geometallurgy
|
|
26
26
|
Project-URL: Repository, https://github.com/elphick/geometallurgy
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from copy import copy
|
|
2
2
|
from enum import Enum
|
|
3
3
|
from functools import reduce
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from typing import Optional, TypeVar, TYPE_CHECKING
|
|
5
6
|
|
|
6
7
|
import numpy as np
|
|
7
8
|
import pandas as pd
|
|
9
|
+
import yaml
|
|
8
10
|
|
|
9
11
|
from elphick.geomet.base import MC
|
|
10
12
|
from elphick.geomet.flowsheet.stream import Stream
|
|
@@ -25,13 +27,22 @@ class NodeType(Enum):
|
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
class Operation:
|
|
28
|
-
def __init__(self, name):
|
|
30
|
+
def __init__(self, name, config_file: Optional[Path] = None):
|
|
29
31
|
self.name = name
|
|
30
32
|
self._inputs = []
|
|
31
33
|
self._outputs = []
|
|
32
34
|
self._is_balanced: Optional[bool] = None
|
|
33
35
|
self._unbalanced_records: Optional[pd.DataFrame] = None
|
|
34
36
|
|
|
37
|
+
# Load configuration
|
|
38
|
+
if config_file is None:
|
|
39
|
+
config_file = Path(__file__).parent / '.././config/mc_config.yml'
|
|
40
|
+
|
|
41
|
+
with open(config_file, 'r') as file:
|
|
42
|
+
config = yaml.safe_load(file)
|
|
43
|
+
self.tol_abs = config['flowsheet']['operation'].get('tol_abs', 1e-6)
|
|
44
|
+
self.tol_rel = config['flowsheet']['operation'].get('tol_rel', 1e-6)
|
|
45
|
+
|
|
35
46
|
@property
|
|
36
47
|
def has_empty_input(self) -> bool:
|
|
37
48
|
return None in self.inputs
|
|
@@ -102,7 +113,8 @@ class Operation:
|
|
|
102
113
|
return None
|
|
103
114
|
|
|
104
115
|
input_mass, output_mass = self.get_input_mass(), self.get_output_mass()
|
|
105
|
-
|
|
116
|
+
mask = ~np.isclose(input_mass, output_mass, atol=self.tol_abs, rtol=self.tol_rel)
|
|
117
|
+
self._unbalanced_records = (input_mass - output_mass).loc[mask.any(axis=1)]
|
|
106
118
|
self._is_balanced = self._unbalanced_records.shape[0] == 0
|
|
107
119
|
|
|
108
120
|
@property
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "geometallurgy"
|
|
3
3
|
packages = [{ include = "elphick/geomet" }]
|
|
4
|
-
version = "0.4.
|
|
4
|
+
version = "0.4.18"
|
|
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"
|
|
@@ -41,13 +41,12 @@ plotly = "^5.22.0"
|
|
|
41
41
|
pandas = ">=1.0"
|
|
42
42
|
periodictable = "^1.7.0"
|
|
43
43
|
#geoh5py = ">=0.8.0,<10.0.0"
|
|
44
|
-
pyarrow = ">=16.1.0
|
|
44
|
+
pyarrow = ">=16.1.0"
|
|
45
45
|
folium = { version = "^0.16.0", optional = true }
|
|
46
46
|
rioxarray = { version = "^0.18.2", optional = true }
|
|
47
47
|
pandera = { version = ">=0.19.3,<0.21.0", extras = ['io'], optional = true }
|
|
48
|
-
omfpandas = { version = ">=0.
|
|
48
|
+
omfpandas = { version = ">=0.9.3", optional = true }
|
|
49
49
|
#omf = { version = "<2.0" }
|
|
50
|
-
|
|
51
50
|
omfvista = { version = ">=0.3.0", optional = true }
|
|
52
51
|
|
|
53
52
|
[tool.poetry.extras]
|
|
@@ -70,6 +69,8 @@ sphinx-autodoc-typehints = "^2.1.1"
|
|
|
70
69
|
pytest-xdist = "^3.6.1"
|
|
71
70
|
pytest-cov = "^5.0.0"
|
|
72
71
|
toml = "^0.10.2"
|
|
72
|
+
dash = "^3.2.0"
|
|
73
|
+
sympy = "^1.14.0"
|
|
73
74
|
|
|
74
75
|
[build-system]
|
|
75
76
|
requires = ["poetry-core"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/flowsheet_example_partition.yaml
RENAMED
|
File without changes
|
{geometallurgy-0.4.16 → geometallurgy-0.4.18}/elphick/geomet/config/flowsheet_example_simple.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|