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

Refactor Fields Module #151

Open
ucapbba opened this issue Jun 5, 2024 · 0 comments · May be fixed by #152
Open

Refactor Fields Module #151

ucapbba opened this issue Jun 5, 2024 · 0 comments · May be fixed by #152
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ucapbba
Copy link
Contributor

ucapbba commented Jun 5, 2024

Aim is to find somewhere between ease of use for a developer (removing confusing code in the module) and a "user/scientist" (adding confusing code like the square brackets when passing a weight)

The fields module is over-designed. Some things can be changed :

  • init_columns (method called by base constructor) isn't really needed - there is an complicated mechanism to find the weights (based on finding square brackets in a string) with many lines of code
  • init_subclass (called by child classes) is also a overly complicated way to pass spin to the class, we can default to 0 and update in a constructor for the rare cases of spin 2

I'm assuming not much need to create new fields on the fly by users, but there are some unit tests for this.

Testing :

  • Regression tests (use existing) + test sample code works as expected - will require updates
  • new tests to ensure Fields handle columns correctly and throw errors if the incorrect number is passed
  • Understandable errors when columns / mapper are incorrect (let's see)
@ucapbba ucapbba self-assigned this Jun 5, 2024
@ucapbba ucapbba linked a pull request Jun 5, 2024 that will close this issue
@ucapbba ucapbba added the enhancement New feature or request label Jun 11, 2024
@ucapbba ucapbba linked a pull request Jun 11, 2024 that will close this issue
ucapbba pushed a commit that referenced this issue Jun 12, 2024
@ntessore ntessore added this to the v24.2 milestone Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants