Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dayabay-model
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
dayabay-data-preservation
dayabay-model
Commits
ed8a7b63
Commit
ed8a7b63
authored
3 months ago
by
Maxim Gonchar
Browse files
Options
Downloads
Patches
Plain Diff
chore: run_dayabay, simplify saving data
parent
a3ca43b3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run_dayabay_v0.py
+2
-31
2 additions, 31 deletions
scripts/run_dayabay_v0.py
with
2 additions
and
31 deletions
scripts/run_dayabay_v0.py
+
2
−
31
View file @
ed8a7b63
...
...
@@ -3,14 +3,13 @@
from
__future__
import
annotations
from
argparse
import
Namespace
from
pathlib
import
Path
from
typing
import
TYPE_CHECKING
from
h5py
import
File
from
dagflow.core
import
Graph
,
NodeStorage
from
dagflow.tools.logger
import
DEBUG
as
INFO4
from
dagflow.tools.logger
import
INFO1
,
INFO2
,
INFO3
,
set_level
from
dagflow.tools.save_records
import
save_records
from
models
import
available_models
,
load_model
if
TYPE_CHECKING
:
...
...
@@ -147,35 +146,7 @@ def main(opts: Namespace) -> None:
def
save_summary
(
summary
:
DataFrame
,
filenames
:
Sequence
[
str
]):
for
ofile
in
filenames
:
if
ofile
!=
"
-
"
:
opath
=
Path
(
ofile
)
Path
(
opath
.
parent
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
match
ofile
.
split
(
"
.
"
):
case
(
*
_
,
"
-
"
):
print
(
summary
)
case
(
*
_
,
"
txt
"
):
summary
.
to_csv
(
ofile
,
sep
=
"
\t
"
,
index
=
False
)
case
(
*
_
,
"
pd
"
,
"
hdf5
"
):
summary
.
to_hdf
(
ofile
,
key
=
"
summary
"
,
index
=
False
,
mode
=
"
w
"
)
case
(
*
_
,
"
hdf5
"
):
rec
=
summary
.
to_records
(
index
=
False
)
l1
=
summary
[
"
name
"
].
str
.
len
().
max
()
newdtype
=
[
(
rec
.
dtype
.
names
[
0
],
f
"
S
{
l1
:
d
}
"
),
*
(
(
rec
.
dtype
.
names
[
i
],
rec
.
dtype
[
i
])
for
i
in
range
(
1
,
len
(
rec
.
dtype
))
),
]
rec
=
rec
.
astype
(
newdtype
)
with
File
(
ofile
,
mode
=
"
w
"
)
as
f
:
f
.
create_dataset
(
"
summary
"
,
data
=
rec
)
case
_
:
raise
ValueError
(
ofile
)
if
ofile
!=
"
-
"
:
print
(
f
"
Write:
{
ofile
}
"
)
save_records
({
"
summary
"
:
summary
},
filenames
,
tsv_allow_no_key
=
True
)
def
plot_graph
(
graph
:
Graph
,
storage
:
NodeStorage
,
opts
:
Namespace
)
->
None
:
...
...
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