geometallurgy 0.4.10__tar.gz → 0.4.11__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.10 → geometallurgy-0.4.11}/PKG-INFO +1 -1
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/flowsheet/flowsheet.py +3 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/interval_sample.py +1 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/interp.py +4 -4
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/pandas.py +1 -1
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/pyproject.toml +1 -1
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/LICENSE +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/README.md +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/__init__.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/base.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/block_model.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/config/__init__.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/config/config_read.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/config/flowsheet_example_partition.yaml +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/config/flowsheet_example_simple.yaml +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/config/mc_config.yml +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/data/downloader.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/data/register.csv +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/datasets/__init__.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/datasets/datasets.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/datasets/downloader.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/datasets/register.csv +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/datasets/sample_data.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/extras.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/flowsheet/__init__.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/flowsheet/loader.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/flowsheet/operation.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/flowsheet/stream.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/io.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/plot.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/profile.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/sample.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/__init__.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/amenability.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/block_model_converter.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/components.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/data.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/estimates.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/interp2.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/layout.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/moisture.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/parallel.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/partition.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/sampling.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/size.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/timer.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/utils/viz.py +0 -0
- {geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/validate.py.hide +0 -0
|
@@ -15,6 +15,7 @@ import seaborn as sns
|
|
|
15
15
|
import yaml
|
|
16
16
|
from matplotlib import pyplot as plt
|
|
17
17
|
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
|
|
18
|
+
from networkx.algorithms.dag import is_directed_acyclic_graph
|
|
18
19
|
from plotly.subplots import make_subplots
|
|
19
20
|
|
|
20
21
|
from elphick.geomet import Sample
|
|
@@ -306,6 +307,8 @@ class Flowsheet:
|
|
|
306
307
|
def solve(self):
|
|
307
308
|
"""Solve missing streams"""
|
|
308
309
|
|
|
310
|
+
assert is_directed_acyclic_graph(self.graph), "Graph is not a Directed Acyclic Graph (DAG), so cannot be solved."
|
|
311
|
+
|
|
309
312
|
# Check the number of missing mc's on edges in the network
|
|
310
313
|
missing_count: int = sum([1 for u, v, d in self.graph.edges(data=True) if d['mc'] is None])
|
|
311
314
|
prev_missing_count = missing_count + 1 # Initialize with a value greater than missing_count
|
|
@@ -585,6 +585,7 @@ class IntervalSample(MassComposition):
|
|
|
585
585
|
df_upsampled: pd.DataFrame = mass_preserving_interp(self.mass_data,
|
|
586
586
|
interval_edges=interval_edges, precision=precision,
|
|
587
587
|
include_original_edges=include_original_edges,
|
|
588
|
+
mass_wet=None, mass_dry=self.mass_dry_var,
|
|
588
589
|
interval_data_as_mass=True)
|
|
589
590
|
|
|
590
591
|
obj: IntervalSample = IntervalSample(df_upsampled, name=self.name, moisture_in_scope=False,
|
|
@@ -9,7 +9,7 @@ from elphick.geomet.utils.pandas import composition_to_mass, mass_to_composition
|
|
|
9
9
|
|
|
10
10
|
def mass_preserving_interp(df_intervals: pd.DataFrame, interval_edges: Union[Iterable, int],
|
|
11
11
|
include_original_edges: bool = True, precision: Optional[int] = None,
|
|
12
|
-
mass_wet: str = 'mass_wet', mass_dry: str = 'mass_dry',
|
|
12
|
+
mass_wet: Optional[str] = 'mass_wet', mass_dry: str = 'mass_dry',
|
|
13
13
|
interval_data_as_mass: bool = False) -> pd.DataFrame:
|
|
14
14
|
"""Interpolate with zero mass loss using pchip
|
|
15
15
|
|
|
@@ -81,7 +81,7 @@ def mass_preserving_interp(df_intervals: pd.DataFrame, interval_edges: Union[Ite
|
|
|
81
81
|
# if the new grid extrapolates (on the coarse side), mass will be lost, so we assume that when extrapolating.
|
|
82
82
|
# the mass in the extrapolated fractions is zero. By inserting these records the spline will conform.
|
|
83
83
|
x_extra = grid_vals[grid_vals > mass_cum.index.max()]
|
|
84
|
-
if x_extra:
|
|
84
|
+
if len(x_extra) > 0:
|
|
85
85
|
cum_max: pd.Series = mass_cum.iloc[-1, :]
|
|
86
86
|
mass_cum = mass_cum.reindex(index=mass_cum.index.append(pd.Index(x_extra))) # reindex to enable insert
|
|
87
87
|
mass_cum.loc[x_extra, :] = cum_max.values
|
|
@@ -180,7 +180,8 @@ def mass_preserving_interp_2d(intervals: pd.DataFrame, interval_edges: dict[str,
|
|
|
180
180
|
# proportion the dim_1 interpolated values by the dim_2 recovery
|
|
181
181
|
new_vals: pd.DataFrame = dim_2_deportment.mul(filtered_intervals_mass.loc[dim_1_interp_interval].values)
|
|
182
182
|
# create a multiindex by combining the dim_1 and dim_2 intervals
|
|
183
|
-
new_index = pd.MultiIndex.from_arrays(
|
|
183
|
+
new_index = pd.MultiIndex.from_arrays(
|
|
184
|
+
[pd.IntervalIndex([dim_1_interp_interval] * len(new_vals)), new_vals.index])
|
|
184
185
|
new_vals.index = new_index
|
|
185
186
|
chunks.append(new_vals)
|
|
186
187
|
|
|
@@ -190,4 +191,3 @@ def mass_preserving_interp_2d(intervals: pd.DataFrame, interval_edges: dict[str,
|
|
|
190
191
|
# convert to composition
|
|
191
192
|
res = mass_to_composition(res, mass_dry=mass_dry)
|
|
192
193
|
return res
|
|
193
|
-
|
|
@@ -88,7 +88,7 @@ def composition_to_mass(df: pd.DataFrame,
|
|
|
88
88
|
df: The pd.DataFrame containing mass. H2O if provided will be ignored. All columns other than the
|
|
89
89
|
mass_wet and mass_dry are assumed to be `additive`, that is, dry mass weighting is valid.
|
|
90
90
|
Assumes composition is in %w/w units.
|
|
91
|
-
mass_wet: The wet mass column, optional.
|
|
91
|
+
mass_wet: The wet mass column, optional.
|
|
92
92
|
mass_dry: The dry mass column, not optional. Consider solve_mass_moisture prior to this call if needed.
|
|
93
93
|
moisture_column_name: if mass_wet is provided, the resultant moisture will be returned with this column name.
|
|
94
94
|
If None, and moisture is detected in the input, that column name will be used instead.
|
|
@@ -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.11"
|
|
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"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{geometallurgy-0.4.10 → geometallurgy-0.4.11}/elphick/geomet/config/flowsheet_example_partition.yaml
RENAMED
|
File without changes
|
{geometallurgy-0.4.10 → geometallurgy-0.4.11}/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
|