Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
JOSSOUD Olivier
CFA Tools
Commits
b329b988
Commit
b329b988
authored
Apr 22, 2021
by
JOSSOUD Olivier
Browse files
Iceblock Processor. Correct FutureWarning.
parent
7d24c990
Pipeline
#115663
passed with stages
in 3 minutes and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
30 deletions
+2
-30
.idea/csv-plugin.xml
.idea/csv-plugin.xml
+0
-28
cfatools/processor/iceblock.py
cfatools/processor/iceblock.py
+2
-2
No files found.
.idea/csv-plugin.xml
View file @
b329b988
...
...
@@ -3,27 +3,6 @@
<component
name=
"CsvFileAttributes"
>
<option
name=
"attributeMap"
>
<map>
<entry
key=
"/cfatools/processor/flow.py"
>
<value>
<Attribute>
<option
name=
"separator"
value=
":"
/>
</Attribute>
</value>
</entry>
<entry
key=
"/cfatools/tests/test_flow/tubing_volumes.csv"
>
<value>
<Attribute>
<option
name=
"separator"
value=
","
/>
</Attribute>
</value>
</entry>
<entry
key=
"/cfatools/tests/test_processor/test_flow.py"
>
<value>
<Attribute>
<option
name=
"separator"
value=
","
/>
</Attribute>
</value>
</entry>
<entry
key=
"/cfatools/tests/test_processor/tubing_volumes.csv"
>
<value>
<Attribute>
...
...
@@ -31,13 +10,6 @@
</Attribute>
</value>
</entry>
<entry
key=
"/config/tubing_volumes.csv"
>
<value>
<Attribute>
<option
name=
"separator"
value=
","
/>
</Attribute>
</value>
</entry>
</map>
</option>
</component>
...
...
cfatools/processor/iceblock.py
View file @
b329b988
...
...
@@ -12,14 +12,14 @@ def get_melting_timeseries(iceblock_df: pd.DataFrame) -> pd.DataFrame:
# Get the mapping between iceblock id and iceblock name (assuming that the last name's modification is the
# good one.
mapping_df
=
iceblock_df
[[
"datetime"
,
"id"
,
"name"
]].
copy
()
mapping_df
=
mapping_df
.
groupby
(
"id"
)[
"id"
,
"name"
].
tail
(
1
)
mapping_df
=
mapping_df
.
groupby
(
"id"
)[
[
"id"
,
"name"
]
]
.
tail
(
1
)
mapping_df
=
mapping_df
.
append
({
"id"
:
0
,
"name"
:
"None"
},
ignore_index
=
True
)
mapping_df
=
mapping_df
.
set_index
(
"id"
)
mapping_dict
=
mapping_df
[
"name"
].
to_dict
()
# Get the datetime of the beginning of each iceblock's melting
melting_df
=
iceblock_df
[[
"datetime"
,
"id"
,
"status"
]].
copy
()
start_df
=
melting_df
[
melting_df
[
"status"
]
==
"Melting"
].
groupby
(
"id"
)[
"datetime"
,
"id"
].
head
(
1
)
start_df
=
melting_df
[
melting_df
[
"status"
]
==
"Melting"
].
groupby
(
"id"
)[
[
"datetime"
,
"id"
]
]
.
head
(
1
)
# Get the end of the last iceblock's melting, and set that after that the current melting block is 0/None.
end_df
=
melting_df
[
melting_df
[
"status"
]
==
"Done"
].
groupby
(
"id"
).
head
(
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment