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

mishandled defaults None of type Param #152

Open
simonesala opened this issue May 24, 2018 · 5 comments
Open

mishandled defaults None of type Param #152

simonesala opened this issue May 24, 2018 · 5 comments
Assignees
Labels
bug child issue This issue should be addressed in a larger rework/context review validator_issues These are issues corresponding to the new validator format.

Comments

@simonesala
Copy link
Contributor

Both in 'core/illumination.py' and 'core/sample.py' parameters of type Param (e.g. 'process' and 'diversity') should result as None by default; upon running ptypy without specifying a value for them (i.e. falling onto defaults) they result in Param containing the other default subparameters instead.
How should the defaults be rewritten to get the intended behaviour? E.g. diversity and process is None by default.

@pierrethibault
Copy link
Member

I am pretty sure the problem is in lines 636-637 of descriptor.py. I can't remember why we thought that we needed this.

@aaron-parsons aaron-parsons added the validator_issues These are issues corresponding to the new validator format. label Jun 11, 2018
aaron-parsons pushed a commit that referenced this issue Jun 12, 2018
… read correctly though which relates to issue #152 (thanks simone for spotting this!)
@aaron-parsons
Copy link

Ok. Bjoern looked at this, and it looks like it's actually the override of default in EvalDescriptor that causes this issue starting line 626. It basically prioritises being a Param over anything else. We'll take a look probably tomorrow now.

@aaron-parsons
Copy link

Sorry I just realised that this was exactly what Pierre said too. My bad!

@aaron-parsons
Copy link

It's interesting. ptypy/test/util_tests/descriptor_test.py seems to pass but it has similar uses inside to what we propose here. I will look to try and break this test tomorrow morning before applying the appropriate fix.

@daurer daurer removed the 0.3 release label Dec 8, 2022
@bjoernenders bjoernenders added review child issue This issue should be addressed in a larger rework/context labels Jan 17, 2023
@bjoernenders
Copy link
Contributor

This requires review if bug is still present today. Adding to the #449 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug child issue This issue should be addressed in a larger rework/context review validator_issues These are issues corresponding to the new validator format.
Projects
None yet
Development

No branches or pull requests

5 participants