geometallurgy 0.4.11__py3-none-any.whl → 0.4.13__py3-none-any.whl
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.
- elphick/geomet/__init__.py +11 -11
- elphick/geomet/base.py +1133 -1133
- elphick/geomet/block_model.py +319 -358
- elphick/geomet/config/__init__.py +1 -1
- elphick/geomet/config/config_read.py +39 -39
- elphick/geomet/config/flowsheet_example_partition.yaml +31 -31
- elphick/geomet/config/flowsheet_example_simple.yaml +25 -25
- elphick/geomet/config/mc_config.yml +35 -35
- elphick/geomet/data/downloader.py +39 -39
- elphick/geomet/data/register.csv +12 -12
- elphick/geomet/datasets/__init__.py +2 -2
- elphick/geomet/datasets/datasets.py +47 -47
- elphick/geomet/datasets/downloader.py +40 -40
- elphick/geomet/datasets/register.csv +12 -12
- elphick/geomet/datasets/sample_data.py +196 -196
- elphick/geomet/extras.py +35 -35
- elphick/geomet/flowsheet/__init__.py +1 -1
- elphick/geomet/flowsheet/flowsheet.py +1216 -1193
- elphick/geomet/flowsheet/loader.py +99 -99
- elphick/geomet/flowsheet/operation.py +256 -256
- elphick/geomet/flowsheet/stream.py +39 -38
- elphick/geomet/interval_sample.py +641 -641
- elphick/geomet/io.py +379 -379
- elphick/geomet/plot.py +147 -147
- elphick/geomet/sample.py +28 -28
- elphick/geomet/utils/amenability.py +49 -49
- elphick/geomet/utils/block_model_converter.py +93 -93
- elphick/geomet/utils/components.py +136 -136
- elphick/geomet/utils/data.py +49 -49
- elphick/geomet/utils/estimates.py +108 -108
- elphick/geomet/utils/interp.py +193 -193
- elphick/geomet/utils/interp2.py +134 -134
- elphick/geomet/utils/layout.py +72 -72
- elphick/geomet/utils/moisture.py +61 -61
- elphick/geomet/utils/output.html +617 -0
- elphick/geomet/utils/pandas.py +378 -378
- elphick/geomet/utils/parallel.py +29 -29
- elphick/geomet/utils/partition.py +63 -63
- elphick/geomet/utils/size.py +51 -51
- elphick/geomet/utils/timer.py +80 -80
- elphick/geomet/utils/viz.py +56 -56
- elphick/geomet/validate.py.hide +176 -176
- {geometallurgy-0.4.11.dist-info → geometallurgy-0.4.13.dist-info}/LICENSE +21 -21
- {geometallurgy-0.4.11.dist-info → geometallurgy-0.4.13.dist-info}/METADATA +7 -5
- geometallurgy-0.4.13.dist-info/RECORD +49 -0
- {geometallurgy-0.4.11.dist-info → geometallurgy-0.4.13.dist-info}/WHEEL +1 -1
- elphick/geomet/utils/sampling.py +0 -5
- geometallurgy-0.4.11.dist-info/RECORD +0 -49
- {geometallurgy-0.4.11.dist-info → geometallurgy-0.4.13.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<title>Converted .py to HTML</title>
|
|
7
|
+
<style>pre { line-height: 125%; }
|
|
8
|
+
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
|
9
|
+
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
|
10
|
+
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
|
11
|
+
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
|
12
|
+
.hll { background-color: #ffffcc }
|
|
13
|
+
.c { color: #3D7B7B; font-style: italic } /* Comment */
|
|
14
|
+
.err { border: 1px solid #FF0000 } /* Error */
|
|
15
|
+
.k { color: #008000; font-weight: bold } /* Keyword */
|
|
16
|
+
.o { color: #666666 } /* Operator */
|
|
17
|
+
.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
|
|
18
|
+
.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
|
|
19
|
+
.cp { color: #9C6500 } /* Comment.Preproc */
|
|
20
|
+
.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
|
|
21
|
+
.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
|
|
22
|
+
.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
|
23
|
+
.gd { color: #A00000 } /* Generic.Deleted */
|
|
24
|
+
.ge { font-style: italic } /* Generic.Emph */
|
|
25
|
+
.ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
|
26
|
+
.gr { color: #E40000 } /* Generic.Error */
|
|
27
|
+
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
|
28
|
+
.gi { color: #008400 } /* Generic.Inserted */
|
|
29
|
+
.go { color: #717171 } /* Generic.Output */
|
|
30
|
+
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
|
31
|
+
.gs { font-weight: bold } /* Generic.Strong */
|
|
32
|
+
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
|
33
|
+
.gt { color: #0044DD } /* Generic.Traceback */
|
|
34
|
+
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
|
|
35
|
+
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
|
|
36
|
+
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
|
|
37
|
+
.kp { color: #008000 } /* Keyword.Pseudo */
|
|
38
|
+
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
|
|
39
|
+
.kt { color: #B00040 } /* Keyword.Type */
|
|
40
|
+
.m { color: #666666 } /* Literal.Number */
|
|
41
|
+
.s { color: #BA2121 } /* Literal.String */
|
|
42
|
+
.na { color: #687822 } /* Name.Attribute */
|
|
43
|
+
.nb { color: #008000 } /* Name.Builtin */
|
|
44
|
+
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
|
|
45
|
+
.no { color: #880000 } /* Name.Constant */
|
|
46
|
+
.nd { color: #AA22FF } /* Name.Decorator */
|
|
47
|
+
.ni { color: #717171; font-weight: bold } /* Name.Entity */
|
|
48
|
+
.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
|
|
49
|
+
.nf { color: #0000FF } /* Name.Function */
|
|
50
|
+
.nl { color: #767600 } /* Name.Label */
|
|
51
|
+
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
|
52
|
+
.nt { color: #008000; font-weight: bold } /* Name.Tag */
|
|
53
|
+
.nv { color: #19177C } /* Name.Variable */
|
|
54
|
+
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
|
55
|
+
.w { color: #bbbbbb } /* Text.Whitespace */
|
|
56
|
+
.mb { color: #666666 } /* Literal.Number.Bin */
|
|
57
|
+
.mf { color: #666666 } /* Literal.Number.Float */
|
|
58
|
+
.mh { color: #666666 } /* Literal.Number.Hex */
|
|
59
|
+
.mi { color: #666666 } /* Literal.Number.Integer */
|
|
60
|
+
.mo { color: #666666 } /* Literal.Number.Oct */
|
|
61
|
+
.sa { color: #BA2121 } /* Literal.String.Affix */
|
|
62
|
+
.sb { color: #BA2121 } /* Literal.String.Backtick */
|
|
63
|
+
.sc { color: #BA2121 } /* Literal.String.Char */
|
|
64
|
+
.dl { color: #BA2121 } /* Literal.String.Delimiter */
|
|
65
|
+
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
|
|
66
|
+
.s2 { color: #BA2121 } /* Literal.String.Double */
|
|
67
|
+
.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
|
|
68
|
+
.sh { color: #BA2121 } /* Literal.String.Heredoc */
|
|
69
|
+
.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
|
|
70
|
+
.sx { color: #008000 } /* Literal.String.Other */
|
|
71
|
+
.sr { color: #A45A77 } /* Literal.String.Regex */
|
|
72
|
+
.s1 { color: #BA2121 } /* Literal.String.Single */
|
|
73
|
+
.ss { color: #19177C } /* Literal.String.Symbol */
|
|
74
|
+
.bp { color: #008000 } /* Name.Builtin.Pseudo */
|
|
75
|
+
.fm { color: #0000FF } /* Name.Function.Magic */
|
|
76
|
+
.vc { color: #19177C } /* Name.Variable.Class */
|
|
77
|
+
.vg { color: #19177C } /* Name.Variable.Global */
|
|
78
|
+
.vi { color: #19177C } /* Name.Variable.Instance */
|
|
79
|
+
.vm { color: #19177C } /* Name.Variable.Magic */
|
|
80
|
+
.il { color: #666666 } /* Literal.Number.Integer.Long */</style>
|
|
81
|
+
</head>
|
|
82
|
+
<body>
|
|
83
|
+
<div><?xml version="1.0" encoding="utf-8"?>
|
|
84
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
85
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
86
|
+
<head>
|
|
87
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
88
|
+
<meta name="generator" content="Docutils 0.20.1: https://docutils.sourceforge.io/" />
|
|
89
|
+
<title><string></title>
|
|
90
|
+
<style type="text/css">
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
:Author: David Goodger (goodger@python.org)
|
|
94
|
+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
|
95
|
+
:Copyright: This stylesheet has been placed in the public domain.
|
|
96
|
+
|
|
97
|
+
Default cascading style sheet for the HTML output of Docutils.
|
|
98
|
+
|
|
99
|
+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
100
|
+
customize this style sheet.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/* used to remove borders from tables and images */
|
|
104
|
+
.borderless, table.borderless td, table.borderless th {
|
|
105
|
+
border: 0 }
|
|
106
|
+
|
|
107
|
+
table.borderless td, table.borderless th {
|
|
108
|
+
/* Override padding for "table.docutils td" with "! important".
|
|
109
|
+
The right padding separates the table cells. */
|
|
110
|
+
padding: 0 0.5em 0 0 ! important }
|
|
111
|
+
|
|
112
|
+
.first {
|
|
113
|
+
/* Override more specific margin styles with "! important". */
|
|
114
|
+
margin-top: 0 ! important }
|
|
115
|
+
|
|
116
|
+
.last, .with-subtitle {
|
|
117
|
+
margin-bottom: 0 ! important }
|
|
118
|
+
|
|
119
|
+
.hidden {
|
|
120
|
+
display: none }
|
|
121
|
+
|
|
122
|
+
.subscript {
|
|
123
|
+
vertical-align: sub;
|
|
124
|
+
font-size: smaller }
|
|
125
|
+
|
|
126
|
+
.superscript {
|
|
127
|
+
vertical-align: super;
|
|
128
|
+
font-size: smaller }
|
|
129
|
+
|
|
130
|
+
a.toc-backref {
|
|
131
|
+
text-decoration: none ;
|
|
132
|
+
color: black }
|
|
133
|
+
|
|
134
|
+
blockquote.epigraph {
|
|
135
|
+
margin: 2em 5em ; }
|
|
136
|
+
|
|
137
|
+
dl.docutils dd {
|
|
138
|
+
margin-bottom: 0.5em }
|
|
139
|
+
|
|
140
|
+
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
|
145
|
+
dl.docutils dt {
|
|
146
|
+
font-weight: bold }
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
div.abstract {
|
|
150
|
+
margin: 2em 5em }
|
|
151
|
+
|
|
152
|
+
div.abstract p.topic-title {
|
|
153
|
+
font-weight: bold ;
|
|
154
|
+
text-align: center }
|
|
155
|
+
|
|
156
|
+
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
157
|
+
div.hint, div.important, div.note, div.tip, div.warning {
|
|
158
|
+
margin: 2em ;
|
|
159
|
+
border: medium outset ;
|
|
160
|
+
padding: 1em }
|
|
161
|
+
|
|
162
|
+
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
163
|
+
div.important p.admonition-title, div.note p.admonition-title,
|
|
164
|
+
div.tip p.admonition-title {
|
|
165
|
+
font-weight: bold ;
|
|
166
|
+
font-family: sans-serif }
|
|
167
|
+
|
|
168
|
+
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
169
|
+
div.danger p.admonition-title, div.error p.admonition-title,
|
|
170
|
+
div.warning p.admonition-title, .code .error {
|
|
171
|
+
color: red ;
|
|
172
|
+
font-weight: bold ;
|
|
173
|
+
font-family: sans-serif }
|
|
174
|
+
|
|
175
|
+
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
176
|
+
compound paragraphs.
|
|
177
|
+
div.compound .compound-first, div.compound .compound-middle {
|
|
178
|
+
margin-bottom: 0.5em }
|
|
179
|
+
|
|
180
|
+
div.compound .compound-last, div.compound .compound-middle {
|
|
181
|
+
margin-top: 0.5em }
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
div.dedication {
|
|
185
|
+
margin: 2em 5em ;
|
|
186
|
+
text-align: center ;
|
|
187
|
+
font-style: italic }
|
|
188
|
+
|
|
189
|
+
div.dedication p.topic-title {
|
|
190
|
+
font-weight: bold ;
|
|
191
|
+
font-style: normal }
|
|
192
|
+
|
|
193
|
+
div.figure {
|
|
194
|
+
margin-left: 2em ;
|
|
195
|
+
margin-right: 2em }
|
|
196
|
+
|
|
197
|
+
div.footer, div.header {
|
|
198
|
+
clear: both;
|
|
199
|
+
font-size: smaller }
|
|
200
|
+
|
|
201
|
+
div.line-block {
|
|
202
|
+
display: block ;
|
|
203
|
+
margin-top: 1em ;
|
|
204
|
+
margin-bottom: 1em }
|
|
205
|
+
|
|
206
|
+
div.line-block div.line-block {
|
|
207
|
+
margin-top: 0 ;
|
|
208
|
+
margin-bottom: 0 ;
|
|
209
|
+
margin-left: 1.5em }
|
|
210
|
+
|
|
211
|
+
div.sidebar {
|
|
212
|
+
margin: 0 0 0.5em 1em ;
|
|
213
|
+
border: medium outset ;
|
|
214
|
+
padding: 1em ;
|
|
215
|
+
background-color: #ffffee ;
|
|
216
|
+
width: 40% ;
|
|
217
|
+
float: right ;
|
|
218
|
+
clear: right }
|
|
219
|
+
|
|
220
|
+
div.sidebar p.rubric {
|
|
221
|
+
font-family: sans-serif ;
|
|
222
|
+
font-size: medium }
|
|
223
|
+
|
|
224
|
+
div.system-messages {
|
|
225
|
+
margin: 5em }
|
|
226
|
+
|
|
227
|
+
div.system-messages h1 {
|
|
228
|
+
color: red }
|
|
229
|
+
|
|
230
|
+
div.system-message {
|
|
231
|
+
border: medium outset ;
|
|
232
|
+
padding: 1em }
|
|
233
|
+
|
|
234
|
+
div.system-message p.system-message-title {
|
|
235
|
+
color: red ;
|
|
236
|
+
font-weight: bold }
|
|
237
|
+
|
|
238
|
+
div.topic {
|
|
239
|
+
margin: 2em }
|
|
240
|
+
|
|
241
|
+
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
242
|
+
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
243
|
+
margin-top: 0.4em }
|
|
244
|
+
|
|
245
|
+
h1.title {
|
|
246
|
+
text-align: center }
|
|
247
|
+
|
|
248
|
+
h2.subtitle {
|
|
249
|
+
text-align: center }
|
|
250
|
+
|
|
251
|
+
hr.docutils {
|
|
252
|
+
width: 75% }
|
|
253
|
+
|
|
254
|
+
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
|
255
|
+
clear: left ;
|
|
256
|
+
float: left ;
|
|
257
|
+
margin-right: 1em }
|
|
258
|
+
|
|
259
|
+
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
260
|
+
clear: right ;
|
|
261
|
+
float: right ;
|
|
262
|
+
margin-left: 1em }
|
|
263
|
+
|
|
264
|
+
img.align-center, .figure.align-center, object.align-center {
|
|
265
|
+
display: block;
|
|
266
|
+
margin-left: auto;
|
|
267
|
+
margin-right: auto;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
table.align-center {
|
|
271
|
+
margin-left: auto;
|
|
272
|
+
margin-right: auto;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.align-left {
|
|
276
|
+
text-align: left }
|
|
277
|
+
|
|
278
|
+
.align-center {
|
|
279
|
+
clear: both ;
|
|
280
|
+
text-align: center }
|
|
281
|
+
|
|
282
|
+
.align-right {
|
|
283
|
+
text-align: right }
|
|
284
|
+
|
|
285
|
+
/* reset inner alignment in figures */
|
|
286
|
+
div.align-right {
|
|
287
|
+
text-align: inherit }
|
|
288
|
+
|
|
289
|
+
/* div.align-center * { */
|
|
290
|
+
/* text-align: left } */
|
|
291
|
+
|
|
292
|
+
.align-top {
|
|
293
|
+
vertical-align: top }
|
|
294
|
+
|
|
295
|
+
.align-middle {
|
|
296
|
+
vertical-align: middle }
|
|
297
|
+
|
|
298
|
+
.align-bottom {
|
|
299
|
+
vertical-align: bottom }
|
|
300
|
+
|
|
301
|
+
ol.simple, ul.simple {
|
|
302
|
+
margin-bottom: 1em }
|
|
303
|
+
|
|
304
|
+
ol.arabic {
|
|
305
|
+
list-style: decimal }
|
|
306
|
+
|
|
307
|
+
ol.loweralpha {
|
|
308
|
+
list-style: lower-alpha }
|
|
309
|
+
|
|
310
|
+
ol.upperalpha {
|
|
311
|
+
list-style: upper-alpha }
|
|
312
|
+
|
|
313
|
+
ol.lowerroman {
|
|
314
|
+
list-style: lower-roman }
|
|
315
|
+
|
|
316
|
+
ol.upperroman {
|
|
317
|
+
list-style: upper-roman }
|
|
318
|
+
|
|
319
|
+
p.attribution {
|
|
320
|
+
text-align: right ;
|
|
321
|
+
margin-left: 50% }
|
|
322
|
+
|
|
323
|
+
p.caption {
|
|
324
|
+
font-style: italic }
|
|
325
|
+
|
|
326
|
+
p.credits {
|
|
327
|
+
font-style: italic ;
|
|
328
|
+
font-size: smaller }
|
|
329
|
+
|
|
330
|
+
p.label {
|
|
331
|
+
white-space: nowrap }
|
|
332
|
+
|
|
333
|
+
p.rubric {
|
|
334
|
+
font-weight: bold ;
|
|
335
|
+
font-size: larger ;
|
|
336
|
+
color: maroon ;
|
|
337
|
+
text-align: center }
|
|
338
|
+
|
|
339
|
+
p.sidebar-title {
|
|
340
|
+
font-family: sans-serif ;
|
|
341
|
+
font-weight: bold ;
|
|
342
|
+
font-size: larger }
|
|
343
|
+
|
|
344
|
+
p.sidebar-subtitle {
|
|
345
|
+
font-family: sans-serif ;
|
|
346
|
+
font-weight: bold }
|
|
347
|
+
|
|
348
|
+
p.topic-title {
|
|
349
|
+
font-weight: bold }
|
|
350
|
+
|
|
351
|
+
pre.address {
|
|
352
|
+
margin-bottom: 0 ;
|
|
353
|
+
margin-top: 0 ;
|
|
354
|
+
font: inherit }
|
|
355
|
+
|
|
356
|
+
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
357
|
+
margin-left: 2em ;
|
|
358
|
+
margin-right: 2em }
|
|
359
|
+
|
|
360
|
+
pre.code .ln { color: grey; } /* line numbers */
|
|
361
|
+
pre.code, code { background-color: #eeeeee }
|
|
362
|
+
pre.code .comment, code .comment { color: #5C6576 }
|
|
363
|
+
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
364
|
+
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
365
|
+
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
366
|
+
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
367
|
+
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
368
|
+
|
|
369
|
+
span.classifier {
|
|
370
|
+
font-family: sans-serif ;
|
|
371
|
+
font-style: oblique }
|
|
372
|
+
|
|
373
|
+
span.classifier-delimiter {
|
|
374
|
+
font-family: sans-serif ;
|
|
375
|
+
font-weight: bold }
|
|
376
|
+
|
|
377
|
+
span.interpreted {
|
|
378
|
+
font-family: sans-serif }
|
|
379
|
+
|
|
380
|
+
span.option {
|
|
381
|
+
white-space: nowrap }
|
|
382
|
+
|
|
383
|
+
span.pre {
|
|
384
|
+
white-space: pre }
|
|
385
|
+
|
|
386
|
+
span.problematic {
|
|
387
|
+
color: red }
|
|
388
|
+
|
|
389
|
+
span.section-subtitle {
|
|
390
|
+
/* font-size relative to parent (h1..h6 element) */
|
|
391
|
+
font-size: 80% }
|
|
392
|
+
|
|
393
|
+
table.citation {
|
|
394
|
+
border-left: solid 1px gray;
|
|
395
|
+
margin-left: 1px }
|
|
396
|
+
|
|
397
|
+
table.docinfo {
|
|
398
|
+
margin: 2em 4em }
|
|
399
|
+
|
|
400
|
+
table.docutils {
|
|
401
|
+
margin-top: 0.5em ;
|
|
402
|
+
margin-bottom: 0.5em }
|
|
403
|
+
|
|
404
|
+
table.footnote {
|
|
405
|
+
border-left: solid 1px black;
|
|
406
|
+
margin-left: 1px }
|
|
407
|
+
|
|
408
|
+
table.docutils td, table.docutils th,
|
|
409
|
+
table.docinfo td, table.docinfo th {
|
|
410
|
+
padding-left: 0.5em ;
|
|
411
|
+
padding-right: 0.5em ;
|
|
412
|
+
vertical-align: top }
|
|
413
|
+
|
|
414
|
+
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
|
415
|
+
font-weight: bold ;
|
|
416
|
+
text-align: left ;
|
|
417
|
+
white-space: nowrap ;
|
|
418
|
+
padding-left: 0 }
|
|
419
|
+
|
|
420
|
+
/* "booktabs" style (no vertical lines) */
|
|
421
|
+
table.docutils.booktabs {
|
|
422
|
+
border: 0px;
|
|
423
|
+
border-top: 2px solid;
|
|
424
|
+
border-bottom: 2px solid;
|
|
425
|
+
border-collapse: collapse;
|
|
426
|
+
}
|
|
427
|
+
table.docutils.booktabs * {
|
|
428
|
+
border: 0px;
|
|
429
|
+
}
|
|
430
|
+
table.docutils.booktabs th {
|
|
431
|
+
border-bottom: thin solid;
|
|
432
|
+
text-align: left;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
|
436
|
+
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
|
437
|
+
font-size: 100% }
|
|
438
|
+
|
|
439
|
+
ul.auto-toc {
|
|
440
|
+
list-style-type: none }
|
|
441
|
+
|
|
442
|
+
</style>
|
|
443
|
+
</head>
|
|
444
|
+
<body>
|
|
445
|
+
<div class="document">
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
<p>"""
|
|
449
|
+
Interval Data
|
|
450
|
+
=============</p>
|
|
451
|
+
<p>This example adds a second dimension. The second dimension is an interval, of the form interval_from, interval_to.
|
|
452
|
+
It is also known as binned data, where each 'bin' is bounded between and upper and lower limit.</p>
|
|
453
|
+
<p>An interval is relevant in geology, when analysing drill hole data.</p>
|
|
454
|
+
<p>Intervals are also encountered in metallurgy, but in that discipline they are often called fractions,
|
|
455
|
+
e.g. size fractions. In that case the typical nomenclature is size_retained, size passing, since the data
|
|
456
|
+
originates from a sieve stack.</p>
|
|
457
|
+
<p>"""
|
|
458
|
+
import logging</p>
|
|
459
|
+
<p>import pandas as pd
|
|
460
|
+
import plotly.io
|
|
461
|
+
from matplotlib import pyplot as plt</p>
|
|
462
|
+
<p>from elphick.geomet import Sample, IntervalSample
|
|
463
|
+
from elphick.geomet.data.downloader import Downloader
|
|
464
|
+
from elphick.geomet.utils.pandas import weight_average
|
|
465
|
+
import plotly.graph_objects as go</p>
|
|
466
|
+
<p># %%
|
|
467
|
+
logging.basicConfig(level=logging.INFO,</p>
|
|
468
|
+
<div class="system-message">
|
|
469
|
+
<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils"><string></tt>, line 28)</p>
|
|
470
|
+
Unexpected indentation.</div>
|
|
471
|
+
<blockquote>
|
|
472
|
+
format='%(asctime)s %(levelname)s %(module)s - %(funcName)s: %(message)s',
|
|
473
|
+
datefmt='%Y-%m-%dT%H:%M:%S%z',
|
|
474
|
+
)</blockquote>
|
|
475
|
+
<p># %%
|
|
476
|
+
#
|
|
477
|
+
# Create a MassComposition object
|
|
478
|
+
# -------------------------------
|
|
479
|
+
#
|
|
480
|
+
# We get some demo data in the form of a pandas DataFrame
|
|
481
|
+
# We create this object as 1D based on the pandas index</p>
|
|
482
|
+
<p>iron_ore_sample_data: pd.DataFrame = Downloader().load_data(datafile='iron_ore_sample_A072391.zip', show_report=False)
|
|
483
|
+
df_data: pd.DataFrame = iron_ore_sample_data
|
|
484
|
+
df_data.head()</p>
|
|
485
|
+
<p># %%</p>
|
|
486
|
+
<p>obj_mc: Sample = Sample(df_data, name='Drill program')
|
|
487
|
+
obj_mc</p>
|
|
488
|
+
<p># %%</p>
|
|
489
|
+
<p>obj_mc.aggregate</p>
|
|
490
|
+
<p># %%
|
|
491
|
+
#
|
|
492
|
+
# Use the normal pandas groupby-apply as needed. Here we leverage the weight_average function
|
|
493
|
+
# from utils.pandas</p>
|
|
494
|
+
<p>hole_average: pd.DataFrame = obj_mc.data.groupby('DHID').apply(weight_average)
|
|
495
|
+
hole_average</p>
|
|
496
|
+
<p># %%
|
|
497
|
+
#
|
|
498
|
+
# We will now make a 2D dataset using DHID and the intervals.
|
|
499
|
+
df_data['DHID'] = df_data['DHID'].astype('category')
|
|
500
|
+
df_data = df_data.reset_index(drop=True).set_index(['DHID', 'interval_from', 'interval_to'])</p>
|
|
501
|
+
<p>obj_mc_2d: IntervalSample = IntervalSample(df_data, name='Drill program')
|
|
502
|
+
print(obj_mc_2d)</p>
|
|
503
|
+
<p># %%
|
|
504
|
+
obj_mc_2d.aggregate</p>
|
|
505
|
+
<p># %%
|
|
506
|
+
obj_mc_2d.data.groupby('DHID').apply(weight_average, <a href="#system-message-1"><span class="problematic" id="problematic-1">**</span></a>{'mass_wet': 'mass_wet', 'moisture_column_name': 'H2O'})</p>
|
|
507
|
+
<div class="system-message" id="system-message-1">
|
|
508
|
+
<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils"><string></tt>, line 73); <em><a href="#problematic-1">backlink</a></em></p>
|
|
509
|
+
Inline strong start-string without end-string.</div>
|
|
510
|
+
<p># %%
|
|
511
|
+
#
|
|
512
|
+
# View some plots
|
|
513
|
+
#</p>
|
|
514
|
+
<p>fig: go.Figure = obj_mc_2d.plot_parallel(color='DHID')
|
|
515
|
+
plotly.io.show(fig)</p>
|
|
516
|
+
<p># %%
|
|
517
|
+
obj_mc_2d.query('DHID=="CBS02"').reset_index('DHID').plot_intervals(variables=['mass_dry', 'Fe', 'SiO2', 'Al2O3'],</p>
|
|
518
|
+
<div class="system-message">
|
|
519
|
+
<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils"><string></tt>, line 86)</p>
|
|
520
|
+
Unexpected indentation.</div>
|
|
521
|
+
<blockquote>
|
|
522
|
+
cumulative=False)</blockquote>
|
|
523
|
+
</div>
|
|
524
|
+
</body>
|
|
525
|
+
</html>
|
|
526
|
+
</div>
|
|
527
|
+
<pre><div class="highlight"><pre><span></span><span class="sd">"""</span>
|
|
528
|
+
<span class="sd">Interval Data</span>
|
|
529
|
+
<span class="sd">=============</span>
|
|
530
|
+
|
|
531
|
+
<span class="sd">This example adds a second dimension. The second dimension is an interval, of the form interval_from, interval_to.</span>
|
|
532
|
+
<span class="sd">It is also known as binned data, where each 'bin' is bounded between and upper and lower limit.</span>
|
|
533
|
+
|
|
534
|
+
<span class="sd">An interval is relevant in geology, when analysing drill hole data.</span>
|
|
535
|
+
|
|
536
|
+
<span class="sd">Intervals are also encountered in metallurgy, but in that discipline they are often called fractions,</span>
|
|
537
|
+
<span class="sd">e.g. size fractions. In that case the typical nomenclature is size_retained, size passing, since the data</span>
|
|
538
|
+
<span class="sd">originates from a sieve stack.</span>
|
|
539
|
+
|
|
540
|
+
<span class="sd">"""</span>
|
|
541
|
+
<span class="kn">import</span> <span class="nn">logging</span>
|
|
542
|
+
|
|
543
|
+
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
|
544
|
+
<span class="kn">import</span> <span class="nn">plotly.io</span>
|
|
545
|
+
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">pyplot</span> <span class="k">as</span> <span class="n">plt</span>
|
|
546
|
+
|
|
547
|
+
<span class="kn">from</span> <span class="nn">elphick.geomet</span> <span class="kn">import</span> <span class="n">Sample</span><span class="p">,</span> <span class="n">IntervalSample</span>
|
|
548
|
+
<span class="kn">from</span> <span class="nn">elphick.geomet.data.downloader</span> <span class="kn">import</span> <span class="n">Downloader</span>
|
|
549
|
+
<span class="kn">from</span> <span class="nn">elphick.geomet.utils.pandas</span> <span class="kn">import</span> <span class="n">weight_average</span>
|
|
550
|
+
<span class="kn">import</span> <span class="nn">plotly.graph_objects</span> <span class="k">as</span> <span class="nn">go</span>
|
|
551
|
+
|
|
552
|
+
<span class="c1"># %%</span>
|
|
553
|
+
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">,</span>
|
|
554
|
+
<span class="nb">format</span><span class="o">=</span><span class="s1">'</span><span class="si">%(asctime)s</span><span class="s1"> </span><span class="si">%(levelname)s</span><span class="s1"> </span><span class="si">%(module)s</span><span class="s1"> - </span><span class="si">%(funcName)s</span><span class="s1">: </span><span class="si">%(message)s</span><span class="s1">'</span><span class="p">,</span>
|
|
555
|
+
<span class="n">datefmt</span><span class="o">=</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%S%z'</span><span class="p">,</span>
|
|
556
|
+
<span class="p">)</span>
|
|
557
|
+
|
|
558
|
+
<span class="c1"># %%</span>
|
|
559
|
+
<span class="c1">#</span>
|
|
560
|
+
<span class="c1"># Create a MassComposition object</span>
|
|
561
|
+
<span class="c1"># -------------------------------</span>
|
|
562
|
+
<span class="c1">#</span>
|
|
563
|
+
<span class="c1"># We get some demo data in the form of a pandas DataFrame</span>
|
|
564
|
+
<span class="c1"># We create this object as 1D based on the pandas index</span>
|
|
565
|
+
|
|
566
|
+
<span class="n">iron_ore_sample_data</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span> <span class="o">=</span> <span class="n">Downloader</span><span class="p">()</span><span class="o">.</span><span class="n">load_data</span><span class="p">(</span><span class="n">datafile</span><span class="o">=</span><span class="s1">'iron_ore_sample_A072391.zip'</span><span class="p">,</span> <span class="n">show_report</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
567
|
+
<span class="n">df_data</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span> <span class="o">=</span> <span class="n">iron_ore_sample_data</span>
|
|
568
|
+
<span class="n">df_data</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>
|
|
569
|
+
|
|
570
|
+
<span class="c1"># %%</span>
|
|
571
|
+
|
|
572
|
+
<span class="n">obj_mc</span><span class="p">:</span> <span class="n">Sample</span> <span class="o">=</span> <span class="n">Sample</span><span class="p">(</span><span class="n">df_data</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">'Drill program'</span><span class="p">)</span>
|
|
573
|
+
<span class="n">obj_mc</span>
|
|
574
|
+
|
|
575
|
+
<span class="c1"># %%</span>
|
|
576
|
+
|
|
577
|
+
<span class="n">obj_mc</span><span class="o">.</span><span class="n">aggregate</span>
|
|
578
|
+
|
|
579
|
+
<span class="c1"># %%</span>
|
|
580
|
+
<span class="c1">#</span>
|
|
581
|
+
<span class="c1"># Use the normal pandas groupby-apply as needed. Here we leverage the weight_average function</span>
|
|
582
|
+
<span class="c1"># from utils.pandas</span>
|
|
583
|
+
|
|
584
|
+
<span class="n">hole_average</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span> <span class="o">=</span> <span class="n">obj_mc</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s1">'DHID'</span><span class="p">)</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="n">weight_average</span><span class="p">)</span>
|
|
585
|
+
<span class="n">hole_average</span>
|
|
586
|
+
|
|
587
|
+
<span class="c1"># %%</span>
|
|
588
|
+
<span class="c1">#</span>
|
|
589
|
+
<span class="c1"># We will now make a 2D dataset using DHID and the intervals.</span>
|
|
590
|
+
<span class="n">df_data</span><span class="p">[</span><span class="s1">'DHID'</span><span class="p">]</span> <span class="o">=</span> <span class="n">df_data</span><span class="p">[</span><span class="s1">'DHID'</span><span class="p">]</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="s1">'category'</span><span class="p">)</span>
|
|
591
|
+
<span class="n">df_data</span> <span class="o">=</span> <span class="n">df_data</span><span class="o">.</span><span class="n">reset_index</span><span class="p">(</span><span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span><span class="o">.</span><span class="n">set_index</span><span class="p">([</span><span class="s1">'DHID'</span><span class="p">,</span> <span class="s1">'interval_from'</span><span class="p">,</span> <span class="s1">'interval_to'</span><span class="p">])</span>
|
|
592
|
+
|
|
593
|
+
<span class="n">obj_mc_2d</span><span class="p">:</span> <span class="n">IntervalSample</span> <span class="o">=</span> <span class="n">IntervalSample</span><span class="p">(</span><span class="n">df_data</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">'Drill program'</span><span class="p">)</span>
|
|
594
|
+
<span class="nb">print</span><span class="p">(</span><span class="n">obj_mc_2d</span><span class="p">)</span>
|
|
595
|
+
|
|
596
|
+
<span class="c1"># %%</span>
|
|
597
|
+
<span class="n">obj_mc_2d</span><span class="o">.</span><span class="n">aggregate</span>
|
|
598
|
+
|
|
599
|
+
<span class="c1"># %%</span>
|
|
600
|
+
<span class="n">obj_mc_2d</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s1">'DHID'</span><span class="p">)</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="n">weight_average</span><span class="p">,</span> <span class="o">**</span><span class="p">{</span><span class="s1">'mass_wet'</span><span class="p">:</span> <span class="s1">'mass_wet'</span><span class="p">,</span> <span class="s1">'moisture_column_name'</span><span class="p">:</span> <span class="s1">'H2O'</span><span class="p">})</span>
|
|
601
|
+
|
|
602
|
+
<span class="c1"># %%</span>
|
|
603
|
+
<span class="c1">#</span>
|
|
604
|
+
<span class="c1"># View some plots</span>
|
|
605
|
+
<span class="c1">#</span>
|
|
606
|
+
|
|
607
|
+
<span class="n">fig</span><span class="p">:</span> <span class="n">go</span><span class="o">.</span><span class="n">Figure</span> <span class="o">=</span> <span class="n">obj_mc_2d</span><span class="o">.</span><span class="n">plot_parallel</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="s1">'DHID'</span><span class="p">)</span>
|
|
608
|
+
<span class="n">plotly</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">show</span><span class="p">(</span><span class="n">fig</span><span class="p">)</span>
|
|
609
|
+
|
|
610
|
+
<span class="c1"># %%</span>
|
|
611
|
+
<span class="n">obj_mc_2d</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="s1">'DHID=="CBS02"'</span><span class="p">)</span><span class="o">.</span><span class="n">reset_index</span><span class="p">(</span><span class="s1">'DHID'</span><span class="p">)</span><span class="o">.</span><span class="n">plot_intervals</span><span class="p">(</span><span class="n">variables</span><span class="o">=</span><span class="p">[</span><span class="s1">'mass_dry'</span><span class="p">,</span> <span class="s1">'Fe'</span><span class="p">,</span> <span class="s1">'SiO2'</span><span class="p">,</span> <span class="s1">'Al2O3'</span><span class="p">],</span>
|
|
612
|
+
<span class="n">cumulative</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
613
|
+
</pre></div>
|
|
614
|
+
</pre>
|
|
615
|
+
</body>
|
|
616
|
+
</html>
|
|
617
|
+
|