Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CFA Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
and
there
.
Show more breadcrumbs
JOSSOUD Olivier
CFA Analysis
Commits
7860a3c0
Commit
7860a3c0
authored
5 years ago
by
JOSSOUD Olivier
Browse files
Options
Downloads
Patches
Plain Diff
Conductcalib. Fix columns order for result export as CSV.
parent
df5dbe12
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dataprovider/conductcalibprovider.py
+26
-5
26 additions, 5 deletions
src/dataprovider/conductcalibprovider.py
with
26 additions
and
5 deletions
src/dataprovider/conductcalibprovider.py
+
26
−
5
View file @
7860a3c0
...
...
@@ -4,7 +4,6 @@ import datetime
import
os
import
re
import
utils
class
ConductCalibProvider
:
used_channels
=
[
"
C1
"
,
"
C2
"
]
...
...
@@ -22,7 +21,12 @@ class ConductCalibProvider:
return
calib_run
def
export_set_as_file
(
self
,
filename
:
str
):
def
export_set_as_file
(
self
,
filename
:
str
)
->
None
:
# Test if filename already has a extension ('.' followed by 3 letters) ; if not: append '.csv'
if
not
re
.
match
(
"
.*\.[a-zA-Z]{3}$
"
,
filename
):
filename
+=
'
.csv
'
# Concatenate the data of all runs of the calibration set in a single pd.Dataframe
set_df
=
pd
.
DataFrame
()
for
run_id
in
self
.
calib_runs
:
calib_run
=
self
.
calib_runs
[
run_id
]
...
...
@@ -31,9 +35,26 @@ class ConductCalibProvider:
run_df
[
"
run_id
"
]
=
run_id
set_df
=
set_df
.
append
(
run_df
)
set_df
.
to_csv
(
path_or_buf
=
filename
,
sep
=
"
\t
"
,
index
=
False
)
# Fix column order. Otherwise they can be randomly set.
column_order
=
[
"
run_id
"
,
"
standard_cond
"
,
"
channel
"
,
"
step
"
,
"
start_datetime
"
,
"
end_datetime
"
,
"
stable_start_datetime
"
,
"
stable_end_datetime
"
,
"
frequency
"
,
"
excite
"
,
"
headgain
"
,
"
mean
"
,
"
std
"
,
"
valid_auto
"
,
"
valid_manu
"
]
set_df
[
column_order
].
to_csv
(
path_or_buf
=
filename
,
sep
=
"
\t
"
,
index
=
False
)
class
CalibRun
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment