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

Make DataContainer an attribute of Effect #482

Merged
merged 8 commits into from
Nov 1, 2024
Merged

Make DataContainer an attribute of Effect #482

merged 8 commits into from
Nov 1, 2024

Conversation

teutoburg
Copy link
Contributor

@teutoburg teutoburg commented Oct 22, 2024

See the linked issue for the corresponding discussion and rationale...

This used to be the base class. Composition over inheritance makes sense in this particular case. An Effect HAS data, rather than BEING data.
@teutoburg teutoburg added refactor Implementation improvement API How users interact with the software effects Related to a ScopeSim effect labels Oct 22, 2024
@teutoburg teutoburg self-assigned this Oct 22, 2024
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.69%. Comparing base (c33f0fe) to head (ea18267).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #482      +/-   ##
==========================================
+ Coverage   76.58%   76.69%   +0.10%     
==========================================
  Files          66       66              
  Lines        8094     8118      +24     
==========================================
+ Hits         6199     6226      +27     
+ Misses       1895     1892       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@teutoburg teutoburg linked an issue Oct 22, 2024 that may be closed by this pull request
@teutoburg teutoburg changed the title Fh/datacont Make DataContainer an attribute of Effect Oct 28, 2024
@teutoburg teutoburg marked this pull request as ready for review October 28, 2024 11:24
Copy link
Collaborator

@hugobuddel hugobuddel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should ensure that the IRDB notebooks run without problem using this branch. Could you please check those notebooks @teutoburg ?

Comment on lines +50 to 57
self.data_container = DataContainer(filename=filename, **kwargs)
self.meta = kwargs.get("meta", {})
self.cmds = kwargs.get("cmds")

self.meta.update(self.data_container.meta)
self.meta["z_order"] = []
self.meta["include"] = True
self.meta.update(kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this last self.meta.update(kwargs) is (currently) superfluous due to the self.meta.update(self.data_container.meta). Nevertheless, I prefer to keep it as-is, because I would prefer that we, in due time, remove the **kwargs from self.data_container = DataContainer(filename=filename, **kwargs).

@teutoburg
Copy link
Contributor Author

I think we should ensure that the IRDB notebooks run without problem using this branch. Could you please check those notebooks @teutoburg ?

Sure, I'll do that. I thought there was something to check before de-drafting this, now I remember 😃

@teutoburg
Copy link
Contributor Author

Notebooks and IRDB tests now pass. The LSS_AGN-02_simulation does not produce a correct result, but that also occurs with ScopeSim from main, so is unrelated to this change 🙃

@teutoburg
Copy link
Contributor Author

teutoburg commented Oct 31, 2024

Notebooks and IRDB tests now pass.

Correction: There is one small thing in MICASO_Sci that fails because the interface changed. After talking to @astronomyk , I'll just remove that from there mark it to skip and later add it to the ScopeSim tests in a revised form, since MICASO_Sci is deprecated anyway...

@hugobuddel
Copy link
Collaborator

Thanks for running the notebooks. I'm fine with some things not working, but we should know about it. (And then indeed mark it as xfail or whatever.)

My main fear now is that I'd like to have METIS_Simulations use a newer version of ScopeSim, but that this might break something.

If you, @teutoburg, are available to fix such things in the next two weeks, then let's merge this now. Otherwise I don't think this is too urgent so I'm personally also fine with merging this after the METIS_Simulation delivery.

I mean, nothing /should/ break, but who knows, experience tells me that often things break anyway.

@teutoburg
Copy link
Contributor Author

If you, @teutoburg, are available to fix such things in the next two weeks, then let's merge this now.

Yes, I'm around next week and at ADASS the week after (IIRC you're there as well?). I'm expecting to have enough boredom at the conference to be able to fix things 🙂

@hugobuddel hugobuddel self-requested a review November 1, 2024 08:59
@teutoburg teutoburg merged commit 050f41b into main Nov 1, 2024
1 check passed
@teutoburg teutoburg deleted the fh/datacont branch November 1, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API How users interact with the software effects Related to a ScopeSim effect refactor Implementation improvement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Make DataContainer an attribute of Effect (instead of a superclass)
2 participants