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
82dee4a1
Commit
82dee4a1
authored
6 years ago
by
Jameson Graef Rollins
Browse files
Options
Downloads
Patches
Plain Diff
don't import matplotlib at all if not plotting
parent
d7984940
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwinc/__main__.py
+12
-12
12 additions, 12 deletions
gwinc/__main__.py
with
12 additions
and
12 deletions
gwinc/__main__.py
+
12
−
12
View file @
82dee4a1
...
...
@@ -111,6 +111,18 @@ def main():
ifo
=
precompIFO
(
ifo
)
print
(
ifo
.
to_txt
(),
end
=
''
)
return
if
args
.
plot
:
if
args
.
save
:
# FIXME: this silliness seems to be the only way to have
# matplotlib usable on systems without a display. There must
# be a better way. 'AGG' is a backend that works without
# displays. but it has to be set before any other matplotlib
# stuff is imported. and we *don't* want it set if we do want
# to show an interactive plot. there doesn't seem a way to
# set this opportunistically.
import
matplotlib
matplotlib
.
use
(
'
AGG
'
)
from
matplotlib
import
pyplot
as
plt
if
args
.
matlab
:
gwinc
=
gwinc_matlab
.
gwinc_matlab
...
...
@@ -135,18 +147,6 @@ def main():
v
=
float
(
v
)
range_params
[
p
]
=
v
if
args
.
save
:
# FIXME: this silliness seems to be the only way to have
# matplotlib usable on systems without a display. There must
# be a better way. 'AGG' is a backend that works without
# displays. but it has to be set before any other matplotlib
# stuff is imported. and we *don't* want it set if we do want
# to show an interactive plot. there doesn't seem a way to
# set this opportunistically.
import
matplotlib
matplotlib
.
use
(
'
AGG
'
)
from
matplotlib
import
pyplot
as
plt
##########
# main calculations
...
...
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