Commit 9edf6c28 authored by Philipp Arras's avatar Philipp Arras
Browse files

Cosmetics

parent 006e4b0b
Pipeline #75159 passed with stages
in 8 minutes and 29 seconds
......@@ -11,48 +11,47 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2019 Max-Planck-Society
# Copyright(C) 2013-2020 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
from itertools import count
import numpy as np
import nifty6 as ift
from .common import setup_function, teardown_function
nr = 0
def name():
global nr
nr += 1
return 'plot{}.png'.format(nr)
name = (f'plot{nr}.png' for nr in count())
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))
gl_space = ift.makeDomain(ift.GLSpace(128))
rg_space1 = ift.makeDomain(ift.RGSpace((10,)))
rg_space2 = ift.makeDomain(ift.RGSpace((8, 6), distances=1))
hp_space = ift.makeDomain(ift.HPSpace(5))
gl_space = ift.makeDomain(ift.GLSpace(10))
fft = ift.FFTOperator(rg_space2)
field_rg1_1 = ift.Field(rg_space1, ift.random.current_rng().standard_normal(100))
field_rg1_2 = ift.Field(rg_space1, ift.random.current_rng().standard_normal(100))
field_rg2 = ift.Field(
rg_space2, ift.random.current_rng().standard_normal((80,60)))
field_hp = ift.Field(hp_space, ift.random.current_rng().standard_normal(12*64**2))
field_gl = ift.Field(gl_space, ift.random.current_rng().standard_normal(32640))
field_rg1_1 = ift.from_random('normal', rg_space1)
field_rg1_2 = ift.from_random('normal', rg_space1)
field_rg2 = ift.from_random('normal', rg_space2)
field_hp = ift.from_random('normal', hp_space)
field_gl = ift.from_random('normal', gl_space)
field_ps = ift.power_analyze(fft.times(field_rg2))
plot = ift.Plot()
plot.add(field_rg1_1, title='Single plot')
plot.output(name=name())
plot.output(name=next(name))
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', name=name())
plot.output(title='Three plots', name=next(name))
plot = ift.Plot()
plot.add(field_hp, title='HP planck-color', colormap='Planck-like')
......@@ -60,7 +59,7 @@ def test_plots():
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', name=name())
plot.output(nx=2, ny=3, title='Five plots', name=next(name))
def test_mf_plot():
......@@ -76,4 +75,4 @@ def test_mf_plot():
plot = ift.Plot()
plot.add(f1, block=False, title='f_space_idx = 1')
plot.add(f2, freq_space_idx=0, title='f_space_idx = 0')
plot.output(nx=2, ny=1, title='MF-Plots, should look identical', name=name())
plot.output(nx=2, ny=1, title='MF-Plots, should look identical', name=next(name))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment