IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue 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
Air Shower Physics
corsika
Commits
02445d4e
Commit
02445d4e
authored
4 years ago
by
Remy Prechelt
Browse files
Options
Downloads
Patches
Plain Diff
Add loading of the summary files for each output.
parent
cedacf87
No related branches found
No related tags found
1 merge request
!317
Output infrastructure and Python analysis library.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/corsika/io/library.py
+27
-1
27 additions, 1 deletion
python/corsika/io/library.py
python/corsika/io/outputs/output.py
+24
-0
24 additions, 0 deletions
python/corsika/io/outputs/output.py
with
51 additions
and
1 deletion
python/corsika/io/library.py
+
27
−
1
View file @
02445d4e
...
...
@@ -45,8 +45,9 @@ class Library(object):
# store the top-level path
self
.
path
=
path
# load the config file
# load the config
and summary
file
s
self
.
config
=
self
.
load_config
(
path
)
self
.
summary
=
self
.
load_summary
(
path
)
# build the list of outputs
self
.
__outputs
=
self
.
__build_outputs
(
path
)
...
...
@@ -101,6 +102,31 @@ class Library(object):
with
open
(
op
.
join
(
path
,
"
config.yaml
"
),
"
r
"
)
as
f
:
return
yaml
.
load
(
f
,
Loader
=
yaml
.
Loader
)
@staticmethod
def
load_summary
(
path
:
str
)
->
Dict
[
str
,
Any
]:
"""
Load the top-level summary from a given library path.
Parameters
----------
path: str
The path to the directory containing the library.
Returns
-------
dict:
The summary as a python dictionary.
Raises
------
FileNotFoundError
If the summary file cannot be found
"""
with
open
(
op
.
join
(
path
,
"
summary.yaml
"
),
"
r
"
)
as
f
:
return
yaml
.
load
(
f
,
Loader
=
yaml
.
Loader
)
@staticmethod
def
__valid_library
(
path
:
str
)
->
bool
:
"""
...
...
This diff is collapsed.
Click to expand it.
python/corsika/io/outputs/output.py
+
24
−
0
View file @
02445d4e
...
...
@@ -106,3 +106,27 @@ class Output(ABC):
"""
with
open
(
op
.
join
(
path
,
"
config.yaml
"
),
"
r
"
)
as
f
:
return
yaml
.
load
(
f
,
Loader
=
yaml
.
Loader
)
@staticmethod
def
load_summary
(
path
:
str
)
->
Dict
[
str
,
Any
]:
"""
Load the top-level summary from a given library path.
Parameters
----------
path: str
The path to the directory containing the library.
Returns
-------
dict:
The summary as a python dictionary.
Raises
------
FileNotFoundError
If the summary file cannot be found
"""
with
open
(
op
.
join
(
path
,
"
summary.yaml
"
),
"
r
"
)
as
f
:
return
yaml
.
load
(
f
,
Loader
=
yaml
.
Loader
)
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