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

Initialization scope in Rec and CoupledRec #33

Open
jacione opened this issue Oct 3, 2024 · 2 comments
Open

Initialization scope in Rec and CoupledRec #33

jacione opened this issue Oct 3, 2024 · 2 comments

Comments

@jacione
Copy link
Contributor

jacione commented Oct 3, 2024

The CoupledRec class has a lot of attributes that are not defined by __init__(). While Python is technically ok with that, I've noticed that it can make it difficult to keep track of things while debugging.

I was planning on moving what I could into the constructor, but then it occurred to me that the Rec class has the same issue. I'm happy to take a look at both if you want.

@bfrosik
Copy link
Contributor

bfrosik commented Oct 3, 2024

The Rec class constructor takes in params argument that is a dictionary with all the parameters defined by configuration. The constructor sets mandatory missing parameters to defaults and saves the updated dictionary to self.params.
The Rec code uses then self.params dictionary to access the parameters. The parameters would not change.
The CoupledRec class follows the model but I see some attributes created, I suppose needed during computing and most likely modified during processing.

@jacione
Copy link
Contributor Author

jacione commented Oct 16, 2024

Ok. I will only modify the CoupledRec class, then.

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