Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pyrost
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cfel-sc-public
Pyrost
Commits
89c2a5eb
Commit
89c2a5eb
authored
4 years ago
by
simply-nicky
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev0'
parents
fb9fb0ef
6bc19813
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/conf.py
+1
-1
1 addition, 1 deletion
docs/conf.py
pyrost/simulation/st_sim.py
+4
-3
4 additions, 3 deletions
pyrost/simulation/st_sim.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
tests/test_pyrost.py
+5
-5
5 additions, 5 deletions
tests/test_pyrost.py
with
11 additions
and
10 deletions
docs/conf.py
+
1
−
1
View file @
89c2a5eb
...
@@ -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 ---------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
pyrost/simulation/st_sim.py
+
4
−
3
View file @
89c2a5eb
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
89c2a5eb
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
tests/test_pyrost.py
+
5
−
5
View file @
89c2a5eb
...
@@ -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
,
...
...
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