Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
4b65c26d
Commit
4b65c26d
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
If possible, set figure size as in script
parent
68b1dd79
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Functional/Python/PyExamples/check_functionality.py
+6
-5
6 additions, 5 deletions
Tests/Functional/Python/PyExamples/check_functionality.py
with
6 additions
and
5 deletions
Tests/Functional/Python/PyExamples/check_functionality.py
+
6
−
5
View file @
4b65c26d
...
...
@@ -5,7 +5,7 @@ The check passes successfully if the example runs without exceptions thrown and
generates non-zero-size intensity image.
"""
import
matplotlib
,
os
,
sys
import
matplotlib
,
os
,
re
,
sys
matplotlib
.
use
(
'
Agg
'
)
from
matplotlib
import
pyplot
as
plt
...
...
@@ -40,12 +40,13 @@ def run_example(filename, output_dir):
if
not
os
.
path
.
exists
(
filename
):
raise
Exception
(
"
Example script
'"
+
filename
+
"'
not found
"
)
print
(
"
Input script:
"
+
filename
,
flush
=
True
)
with
open
(
filename
,
'
r
b
'
)
as
file
:
with
open
(
filename
,
'
r
'
)
as
file
:
script
=
file
.
read
()
if
"
AllFormFactorsAvailable
"
in
filename
:
figsize
=
(
1024
,
768
)
else
:
m
=
re
.
search
(
r
'
plt\.figure\(.+?figsize=\((.+?),(.+?)\)
'
,
script
)
if
m
:
# set figure size as in script
figsize
=
(
float
(
m
.
group
(
1
)),
float
(
m
.
group
(
2
)))
else
:
# script does not specify figure size
figsize
=
(
640
,
480
)
fig
=
get_figure
(
figsize
)
...
...
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