Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockFull model: some paramteres are documented as default, but aren't #557

Open
kahntm opened this issue Jul 11, 2024 · 0 comments
Open

Comments

@kahntm
Copy link
Contributor

kahntm commented Jul 11, 2024

When converting a script using the "Full" model to the "BlockFull" model I came across a few differences between those models.

When just changing p.scans.scan00.name = 'Full' to = 'BlockFull' and trying to run the script (which ran before) it complains in the probe initialization:

---- Probe initialization ------------------------------------------------------
Initializing probe storage Sscan00G00 using scan scan00.
...
File ".../ptypy/ptypy/utils/parameters.py", line 104, in getattr
raise AttributeError(ke)
AttributeError: 'diversity'

So adding p.scans.scan00.illumination.diversity = None will make it run. Fine if no probe modes are being used.
Adding p.scans.scan00.illumination.diversity = u.Param() instead, will make it fail again.

First:

File ".../ptypy/ptypy/utils/parameters.py", line 91, in getitem
return super(Param, self).getitem(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'power'

So,adding the power argument explicitly, even though it has a default according to the documentation.

p.scans.scan00.illumination.diversity.power = 0.1

Running that gets you the next error...

File ".../ptypy/ptypy/utils/parameters.py", line 104, in getattr
raise AttributeError(ke)
AttributeError: 'noise'

Same story for the noise argument.

p.scans.scan00.illumination.diversity.noise = (0.5, 1.0)

I remember more of such cases when it came to using 'BlockFull'. For example when putting in a numpy array as initial sample estimate. In all cases the documentation says there is a default for a certain parameter, same as for "Full". But there is not and it needs to be explicitly defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant