Skip to content
Snippets Groups Projects
Commit 89c2a5eb authored by simply-nicky's avatar simply-nicky
Browse files

Merge branch 'dev0'

parents fb9fb0ef 6bc19813
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ copyright = '2020, Nikolay Ivanov' ...@@ -22,7 +22,7 @@ copyright = '2020, Nikolay Ivanov'
author = 'Nikolay Ivanov' author = 'Nikolay Ivanov'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = '0.3.0' release = '0.3.1'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
......
...@@ -14,7 +14,7 @@ Perform the simulation for a given :class:`pyrost.simulation.STParams` object. ...@@ -14,7 +14,7 @@ Perform the simulation for a given :class:`pyrost.simulation.STParams` object.
>>> import pyrost.simulation as st_sim >>> import pyrost.simulation as st_sim
>>> st_params = st_sim.parameters() >>> st_params = st_sim.parameters()
>>> sim_obj = st_sim.STSim(params=st_params) >>> sim_obj = st_sim.STSim(st_params)
Return an array of intensity frames at the detector's plane. Return an array of intensity frames at the detector's plane.
...@@ -91,7 +91,8 @@ class STSim(DataContainer): ...@@ -91,7 +91,8 @@ class STSim(DataContainer):
init_set = {'b_steps', 'b_profile', 'det_wfx', 'det_wfy', 'det_ix', 'det_iy', init_set = {'b_steps', 'b_profile', 'det_wfx', 'det_wfy', 'det_ix', 'det_iy',
'lens_wfx', 'lens_wfy','n_x', 'n_y', 'sample_wfx', 'sample_wfy'} 'lens_wfx', 'lens_wfy','n_x', 'n_y', 'sample_wfx', 'sample_wfy'}
def __init__(self, **kwargs): def __init__(self, params, **kwargs):
kwargs['params'] = params
super(STSim, self).__init__(**kwargs) super(STSim, self).__init__(**kwargs)
self._init_dict() self._init_dict()
...@@ -466,7 +467,7 @@ def main(): ...@@ -466,7 +467,7 @@ def main():
st_params = STParams.import_dict(**args) st_params = STParams.import_dict(**args)
st_converter = STConverter() st_converter = STConverter()
sim_obj = STSim(params=st_params) sim_obj = STSim(st_params)
if args['ptych']: if args['ptych']:
data = sim_obj.ptychograph() data = sim_obj.ptychograph()
else: else:
......
...@@ -39,7 +39,7 @@ with open('README.md', 'r') as readme: ...@@ -39,7 +39,7 @@ with open('README.md', 'r') as readme:
long_description = readme.read() long_description = readme.read()
setup(name='pyrost', setup(name='pyrost',
version='0.3.0', version='0.3.1',
author='Nikolay Ivanov', author='Nikolay Ivanov',
author_email="nikolay.ivanov@desy.de", author_email="nikolay.ivanov@desy.de",
long_description=long_description, long_description=long_description,
......
...@@ -75,8 +75,8 @@ def test_st_params(st_params, ini_path): ...@@ -75,8 +75,8 @@ def test_st_params(st_params, ini_path):
@pytest.mark.st_sim @pytest.mark.st_sim
def test_st_sim(st_params): def test_st_sim(st_params):
with st_sim.STSim(st_params) as sim_obj: sim_obj = st_sim.STSim(st_params)
ptych = sim_obj.ptychograph() ptych = sim_obj.ptychograph()
assert len(ptych.shape) == 3 assert len(ptych.shape) == 3
assert ptych.shape[0] == st_params.n_frames assert ptych.shape[0] == st_params.n_frames
...@@ -119,9 +119,9 @@ def test_data_process_routines(exp_data_2d, loader): ...@@ -119,9 +119,9 @@ def test_data_process_routines(exp_data_2d, loader):
@pytest.mark.standalone @pytest.mark.standalone
def test_full(st_params, converter): def test_full(st_params, converter):
with st_sim.STSim(st_params) as sim_obj: sim_obj = st_sim.STSim(st_params)
ptych = sim_obj.ptychograph() ptych = sim_obj.ptychograph()
data = converter.export_data(ptych, st_params) data = converter.export_data(ptych, st_params)
assert data.data.dtype == converter.protocol.known_types['float'] assert data.data.dtype == converter.protocol.known_types['float']
st_obj = data.get_st() st_obj = data.get_st()
st_res = st_obj.iter_update(sw_fs=20, ls_pm=3, ls_ri=5, st_res = st_obj.iter_update(sw_fs=20, ls_pm=3, ls_ri=5,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment