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

Parameter validation error in 3d branch after recent commits #167

Open
susannahammarberg opened this issue Aug 28, 2018 · 6 comments
Open
Labels
1.0 Need to be resolved before the first major realese child issue This issue should be addressed in a larger rework/context review
Projects

Comments

@susannahammarberg
Copy link
Contributor

Hey!

I have problems running reconstructions in the 3d branch after recent commits. Ptypy complains about me not stating a name for the PtyScan subclass in my initialization script (but I do..).
In my script I have something like:

p.scans = u.Param()
p.scans.scan01 = u.Param()
p.scans.scan01.name = 'Bragg3dModel'
p.scans.scan01.data= u.Param()
p.scans.scan01.data.name = 'Bragg3dSimScan'

and I get the error: "Parameter validation failed:
scans.scan01.data - make sure to specify the .name field"

(and if I go back to the commit I used previously, there was a problem with the ptyr-files being empty, so I dont know which commit to go back to).

Thanks in advance for advice!
Sanna

@pierrethibault
Copy link
Member

Hi Sanna,

I think that this behaviour has been introduced recently in an attempt to avoid all ptyscan subclasses to be imported because it reality only one at a time is needed. Can you try to add the specific import at the top of your script?

from ptypy.experiment import Bragg3dSim

This should load your ptyscan class.

Pierre

@susannahammarberg
Copy link
Contributor Author

Yes, that worked! Thank you.

Sanna

@alexbjorling
Copy link

We should produce some more reasonable error message here.

@pierrethibault
Copy link
Member

I suggest that we manage this through custom exception classes (i.e. MissingParameterError, UnknownParameterError, TypeParameterError). We should consider doing this throughout ptypy...

@aaron-parsons
Copy link

I'm bumping this to the 0.4 release, since the 0.3 is basically done now. If it get's too annoying then a patch would be fine to do.

@aaron-parsons aaron-parsons added this to To do in 0.4 release Sep 11, 2018
@daurer daurer removed the 0.4 label Dec 8, 2022
@bjoernenders bjoernenders added review 1.0 Need to be resolved before the first major realese child issue This issue should be addressed in a larger rework/context labels Jan 17, 2023
@bjoernenders
Copy link
Contributor

bjoernenders commented Jan 17, 2023

Needs to be reviewed if there is still a bug. Looks like it belongs to the Param evualation. #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Need to be resolved before the first major realese child issue This issue should be addressed in a larger rework/context review
Projects
No open projects
0.4 release
  
To do
Development

No branches or pull requests

6 participants