Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ale
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
aflab
astrogeology
Ale
Commits
699582f0
Commit
699582f0
authored
4 years ago
by
Jesse Mapel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed pre-parse try except (#414)
* Fixed pre-parse try except * Fixed comparison warnings
parent
fb162335
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ale/drivers/__init__.py
+10
-7
10 additions, 7 deletions
ale/drivers/__init__.py
ale/transformation.py
+4
-4
4 additions, 4 deletions
ale/transformation.py
with
14 additions
and
11 deletions
ale/drivers/__init__.py
+
10
−
7
View file @
699582f0
...
...
@@ -98,13 +98,16 @@ def load(label, props={}, formatter='ale', verbose=False):
try
:
# Try default grammar for pds3 label
parsed_label
=
parse_label
(
label
)
except
ValueError
as
e
:
except
Exception
as
e
:
if
verbose
:
print
(
"
First parse attempt failed with
"
)
print
(
e
)
# If pds3 label fails, try isis grammar
try
:
parsed_label
=
parse_label
(
label
,
pvl
.
grammar
.
ISISGrammar
())
except
Exception
as
e
:
if
verbose
:
print
(
"
Second parse attempt failed with
"
)
print
(
e
)
# If both fail, then don't parse the label, and just pass the driver a file.
parsed_label
=
None
...
...
This diff is collapsed.
Click to expand it.
ale/transformation.py
+
4
−
4
View file @
699582f0
...
...
@@ -154,23 +154,23 @@ class FrameChain(nx.DiGraph):
print
(
e
)
break
if
frame_type
is
1
or
frame_type
is
2
:
if
frame_type
==
1
or
frame_type
==
2
:
frame_code
=
1
elif
frame_type
is
3
:
elif
frame_type
==
3
:
try
:
matrix
,
frame_code
=
spice
.
ckfrot
(
frame_type_id
,
ephemeris_time
)
except
:
raise
Exception
(
f
"
The ck rotation from frame
{
frame_codes
[
-
1
]
}
can not
\
be found due to no pointing available at requested time
\
or a problem with the frame
"
)
elif
frame_type
is
4
:
elif
frame_type
==
4
:
try
:
matrix
,
frame_code
=
spice
.
tkfram
(
frame_type_id
)
except
:
raise
Exception
(
f
"
The tk rotation from frame
{
frame_codes
[
-
1
]
}
can not
\
be found
"
)
elif
frame_type
is
5
:
elif
frame_type
==
5
:
matrix
,
frame_code
=
spice
.
zzdynrot
(
frame_type_id
,
center
,
ephemeris_time
)
else
:
...
...
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