Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neel Shah
NIFTy
Commits
4c3c5422
Commit
4c3c5422
authored
Aug 10, 2019
by
Philipp Arras
Browse files
Add plot tests to test suite
parent
c0e342f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
4c3c5422
...
...
@@ -111,3 +111,11 @@ run_curve_fitting:
artifacts
:
paths
:
-
'
*.png'
run_plotting_test
:
stage
:
demo_runs
script
:
-
python3 demos/polynomial_fit.py
artifacts
:
paths
:
-
'
*.png'
demos/plot_tes
t.py
→
test/test_plo
t.py
View file @
4c3c5422
...
...
@@ -15,11 +15,13 @@
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
import
nifty5
as
ift
import
numpy
as
np
import
nifty5
as
ift
def
plot_test
():
def
test_plots
():
# FIXME Write to temporary folder?
rg_space1
=
ift
.
makeDomain
(
ift
.
RGSpace
((
100
,)))
rg_space2
=
ift
.
makeDomain
(
ift
.
RGSpace
((
80
,
60
),
distances
=
1
))
hp_space
=
ift
.
makeDomain
(
ift
.
HPSpace
(
64
))
...
...
@@ -35,18 +37,16 @@ def plot_test():
field_gl
=
ift
.
Field
.
from_global_data
(
gl_space
,
np
.
random
.
randn
(
32640
))
field_ps
=
ift
.
power_analyze
(
fft
.
times
(
field_rg2
))
# Start various plotting tests
plot
=
ift
.
Plot
()
plot
.
add
(
field_rg1_1
,
title
=
'Single plot'
)
plot
.
output
()
plot
.
output
(
name
=
'plot1.png'
)
plot
=
ift
.
Plot
()
plot
.
add
(
field_rg2
,
title
=
'2d rg'
)
plot
.
add
([
field_rg1_1
,
field_rg1_2
],
title
=
'list 1d rg'
,
label
=
[
'1'
,
'2'
])
plot
.
add
(
field_rg1_2
,
title
=
'1d rg, xmin, ymin'
,
xmin
=
0.5
,
ymin
=
0.
,
xlabel
=
'xmin=0.5'
,
ylabel
=
'ymin=0'
)
plot
.
output
(
title
=
'Three plots'
)
plot
.
output
(
title
=
'Three plots'
,
name
=
'plot2.png'
)
plot
=
ift
.
Plot
()
plot
.
add
(
field_hp
,
title
=
'HP planck-color'
,
colormap
=
'Planck-like'
)
...
...
@@ -54,8 +54,4 @@ def plot_test():
plot
.
add
(
field_ps
)
plot
.
add
(
field_gl
,
title
=
'GL'
)
plot
.
add
(
field_rg2
,
title
=
'2d rg'
)
plot
.
output
(
nx
=
2
,
ny
=
3
,
title
=
'Five plots'
)
if
__name__
==
'__main__'
:
plot_test
()
plot
.
output
(
nx
=
2
,
ny
=
3
,
title
=
'Five plots'
,
name
=
'plot3.png'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment