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

AttributeError: 'ConfigObject' object has no attribute 'pixelsize_diff' #37

Closed
kttn8769 opened this issue Jun 1, 2020 · 4 comments
Closed

Comments

@kttn8769
Copy link
Contributor

kttn8769 commented Jun 1, 2020

Hi,

I have noticed that config.calibration.pixelsize_diff is not accessible after importing instamatic.config.

Accessing config.calibration.pixelsize_diff throws an exception AttributeError: 'ConfigObject' object has no attribute 'pixelsize_diff'.

Is this an expected behavior?
I'm using commit fa6af76 in the sumulation mode.

And could you please show me in which code the attribute pixelsize_diff is defined?

Sorry I'm asking you many times these days.
Thanks!

@kttn8769 kttn8769 closed this as completed Jun 1, 2020
@kttn8769 kttn8769 reopened this Jun 1, 2020
@stefsmeets
Copy link
Member

Hi @kttn8769, try: config.calibration['diff']['pixelsize']

stefsmeets added a commit that referenced this issue Jun 2, 2020
@stefsmeets
Copy link
Member

stefsmeets commented Jun 2, 2020

And could you please show me in which code the attribute pixelsize_diff is defined?

The values are defined in your calibration yaml: instamatic -l calibration. In the code it's here: https://github.com/stefsmeets/instamatic/blob/master/instamatic/config/__init__.py#L96

Can you tell me where you found the syntax you used? I changed this already a while ago, because accessing the config in this way caused problems, but I noticed some references in the code that I forgot to update.

@kttn8769
Copy link
Contributor Author

kttn8769 commented Jun 2, 2020

Hi @stefsmeets ,

Ok, I understand the syntax is old-style, thank you.

I noticed this while I was reading instamatic.experiments.cred.experiment.Experiment.start_collection method to see how cRED is implemented.

By the way, I found two possible typos,
https://github.com/stefsmeets/instamatic/blob/fbb001920cfbc3ecc1f6026e2f74433232118729/instamatic/main.py#L126
https://github.com/stefsmeets/instamatic/blob/fbb001920cfbc3ecc1f6026e2f74433232118729/instamatic/gui/debug_frame.py#L9

config.locations instead of config.location?

@stefsmeets
Copy link
Member

Yep, good point! Thanks for the heads-up. Somehow I missed these variables when sweeping through the code.

I should find a way to incorporate the experimental part in the automated tests to catch this.

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

2 participants