Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
l2json
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David McKenna
l2json
Commits
a05ab1d1
Commit
a05ab1d1
authored
2 months ago
by
David McKenna
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Pass on invalid station configurations instead of exiting.
parent
86a77e80
Branches
Branches containing commit
No related tags found
1 merge request
!38
FIX: Pass on invalid station configurations instead of exiting.
Pipeline
#121304
passed
2 months ago
Stage: prepare
Stage: test
Stage: package
Pipeline: l2json
#121305
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
l2json/parsers/parse_json.py
+1
-1
1 addition, 1 deletion
l2json/parsers/parse_json.py
l2json/sources/generators.py
+5
-2
5 additions, 2 deletions
l2json/sources/generators.py
with
6 additions
and
3 deletions
l2json/parsers/parse_json.py
+
1
−
1
View file @
a05ab1d1
...
@@ -103,7 +103,7 @@ def get_last_valid_device_value(
...
@@ -103,7 +103,7 @@ def get_last_valid_device_value(
value
=
get_value_from_metadata
(
metadata
,
antennafield
,
output_key
,
device_mapping
)
value
=
get_value_from_metadata
(
metadata
,
antennafield
,
output_key
,
device_mapping
)
if
value
is
not
None
:
if
value
is
not
None
:
return
value
return
value
raise
KeyError
(
f
"
No value found for
{
output_key
=
}
in provided metadata dicts.
"
)
print
(
f
"
No value found for
{
output_key
=
}
in provided metadata dicts.
"
)
# def get_static_metadata(filtered_metadata: list[dict[str, Any]], antennafield: str, keys: set[str]) -> dict[str, str]:
# def get_static_metadata(filtered_metadata: list[dict[str, Any]], antennafield: str, keys: set[str]) -> dict[str, str]:
...
...
This diff is collapsed.
Click to expand it.
l2json/sources/generators.py
+
5
−
2
View file @
a05ab1d1
...
@@ -106,6 +106,9 @@ def yield_l2obs_from_params(
...
@@ -106,6 +106,9 @@ def yield_l2obs_from_params(
continue
continue
# filtered_metadata, filtered_data = metadata, data
# filtered_metadata, filtered_data = metadata, data
try
:
l2obs
=
parse_json
.
build_lofar2_observation
(
filtered_metadata
,
filtered_data
)
l2obs
=
parse_json
.
build_lofar2_observation
(
filtered_metadata
,
filtered_data
)
yield
(
station
,
field
,
datatype
,
obs_id
),
l2obs
yield
(
station
,
field
,
datatype
,
obs_id
),
l2obs
except
Exception
as
e
:
print
(
f
"
Skipping
{
obs_id
=
}
for
{
station
}{
field
}
due to
{
e
=
}
"
)
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