Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lee McCuller
pygwinc
Commits
fc3a6a2e
Commit
fc3a6a2e
authored
4 years ago
by
Jameson Rollins
Browse files
Options
Downloads
Patches
Plain Diff
cli: tweak error messages, and argument help
parent
8387c7db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwinc/__main__.py
+10
-9
10 additions, 9 deletions
gwinc/__main__.py
with
10 additions
and
9 deletions
gwinc/__main__.py
+
10
−
9
View file @
fc3a6a2e
...
...
@@ -61,7 +61,7 @@ parser = argparse.ArgumentParser(
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
)
parser
.
add_argument
(
'
--freq
'
,
'
-f
'
,
metavar
=
'
FLO:[NPOINTS:]FHI
'
,
help
=
"
frequency array specification in Hz [{}]
"
.
format
(
FREQ
))
help
=
"
logarithmic
frequency array specification in Hz [{}]
"
.
format
(
FREQ
))
parser
.
add_argument
(
'
--ifo
'
,
'
-o
'
,
metavar
=
'
PARAM=VAL
'
,
#nargs='+', action='extend',
...
...
@@ -118,9 +118,9 @@ def main():
if
os
.
path
.
splitext
(
os
.
path
.
basename
(
args
.
IFO
))[
1
]
in
DATA_SAVE_FORMATS
:
if
args
.
freq
:
parser
.
exit
(
2
,
"
Can not specify frequency array
when loading traces from file.
\n
"
)
parser
.
exit
(
2
,
"
Frequency specification not allowed
when loading traces from file.
\n
"
)
if
args
.
ifo
:
parser
.
exit
(
2
,
"
Can not override ifo parameters
when loading traces from file.
\n
"
)
parser
.
exit
(
2
,
"
IFO parameter specification not allowed
when loading traces from file.
\n
"
)
from
.io
import
load_hdf5
Budget
=
None
freq
,
traces
,
attrs
=
load_hdf5
(
args
.
IFO
)
...
...
@@ -136,7 +136,7 @@ def main():
try
:
freq
=
freq_from_spec
(
args
.
freq
)
except
IndexError
:
parser
.
e
rror
(
"
i
mproper frequency specification
'
{}
'
"
.
format
(
args
.
freq
))
parser
.
e
xit
(
2
,
"
I
mproper frequency specification
: {}
\n
"
.
format
(
args
.
freq
))
else
:
freq
=
getattr
(
Budget
,
'
freq
'
,
freq_from_spec
(
FREQ
))
plot_style
=
getattr
(
Budget
,
'
plot_style
'
,
{})
...
...
@@ -149,17 +149,18 @@ def main():
if
args
.
yaml
:
if
not
ifo
:
parser
.
exit
(
2
,
"
No
'
ifo
'
structure
available
.
\n
"
)
parser
.
exit
(
2
,
"
IFO
structure
not provided
.
\n
"
)
print
(
ifo
.
to_yaml
(),
end
=
''
)
return
if
args
.
text
:
if
not
ifo
:
parser
.
exit
(
2
,
"
No
'
ifo
'
structure
available
.
\n
"
)
parser
.
exit
(
2
,
"
IFO
structure
not provided
.
\n
"
)
print
(
ifo
.
to_txt
(),
end
=
''
)
return
if
args
.
diff
:
if
not
ifo
:
parser
.
exit
(
2
,
"
No
'
ifo
'
structure available.
\n
"
)
parser
.
exit
(
2
,
"
IFO structure not provided.
\n
"
)
_
,
difo
=
load_budget
(
args
.
diff
)
Budget
=
load_budget
(
args
.
diff
)
diffs
=
ifo
.
diff
(
Budget
.
ifo
)
if
diffs
:
...
...
@@ -272,8 +273,8 @@ def main():
if
args
.
interactive
:
banner
=
"""
GWINC interactive shell
The
'
ifo
'
Struct and
'
traces
'
data are available for
inspection.
Use the
'
whos
'
command to view the workspace.
The
'
ifo
'
Struct and
'
traces
'
data
objects
are available for
inspection.
Use the
'
whos
'
command to view the workspace.
"""
if
not
args
.
plot
:
banner
+=
"""
...
...
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