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
245f20b6
Commit
245f20b6
authored
7 months ago
by
Alan Coleman
Committed by
Marvin Gottowik
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix static vs class issues
parent
a6436674
No related branches found
No related tags found
1 merge request
!657
Improved handling of corsika.Library
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/corsika/io/library.py
+17
-6
17 additions, 6 deletions
python/corsika/io/library.py
with
17 additions
and
6 deletions
python/corsika/io/library.py
+
17
−
6
View file @
245f20b6
...
...
@@ -133,7 +133,7 @@ class Library(object):
"""
return
self
.
__load_yaml
(
path
,
"
config.yaml
"
)
return
Library
.
__load_yaml
(
path
,
"
config.yaml
"
)
@staticmethod
def
load_summary
(
path
:
str
)
->
Optional
[
Dict
[
str
,
Any
]]:
...
...
@@ -153,7 +153,7 @@ class Library(object):
"""
return
self
.
__load_yaml
(
path
,
"
summary.yaml
"
)
return
Library
.
__load_yaml
(
path
,
"
summary.yaml
"
)
@staticmethod
def
__valid_library
(
path
:
str
)
->
bool
:
...
...
@@ -185,7 +185,9 @@ class Library(object):
return
config
[
"
creator
"
]
==
"
CORSIKA8
"
@staticmethod
def
__build_outputs
(
path
:
str
,
dirs
:
Union
[
list
,
None
])
->
Dict
[
str
,
outputs
.
Output
]:
def
__build_outputs
(
path
:
str
,
dirs
:
Union
[
list
,
None
]
)
->
Dict
[
str
,
outputs
.
Output
]:
"""
Build the outputs contained in this library.
...
...
@@ -233,7 +235,10 @@ class Library(object):
# if `out_type` was None, this is an invalid output
if
out_type
is
None
or
name
is
None
:
msg
=
f
"'
{
subdir
}
'
does not contain a valid config.
"
"
Missing
'
type
'
or
'
name
'
keyword.
"
msg
=
(
f
"'
{
subdir
}
'
does not contain a valid config.
"
"
Missing
'
type
'
or
'
name
'
keyword.
"
)
logging
.
getLogger
(
"
corsika
"
).
warning
(
msg
)
continue
# skip to the next output, don't error
...
...
@@ -245,13 +250,19 @@ class Library(object):
# check if the read failed
if
not
component
.
is_good
():
msg
=
f
"'
{
name
}
'
encountered an error while reading.
"
"
This process will be not be loaded.
"
msg
=
(
f
"'
{
name
}
'
encountered an error while reading.
"
"
This process will be not be loaded.
"
)
logging
.
getLogger
(
"
corsika
"
).
warning
(
msg
)
else
:
components
[
name
]
=
component
except
AttributeError
as
e
:
msg
=
f
"
Unable to instantiate an instance of
'
{
out_type
}
'
"
f
"
for a process called
'
{
name
}
'
. Skipping
'
{
subdir
}
'"
msg
=
(
f
"
Unable to instantiate an instance of
'
{
out_type
}
'
"
f
"
for a process called
'
{
name
}
'
. Skipping
'
{
subdir
}
'"
)
logging
.
getLogger
(
"
corsika
"
).
warning
(
msg
)
logging
.
getLogger
(
"
corsika
"
).
warning
(
e
)
continue
# skip to the next output, don't error
...
...
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