Skip to content

Adoption to new easyscience (fitting, parameter unique name #173

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

Merged
merged 30 commits into from
Aug 29, 2024

Conversation

andped10
Copy link
Collaborator

@andped10 andped10 commented Aug 19, 2024

No intended changes to functionality only adoption to the new easyscience lib.

Main changes are

  • raw_value -> value
  • uid -> unique_name
  • Various updates to as_dict and from_dict
  • introduced new variable populate_if_none to prevent the creation of internal variables when creating an object using from_dict
  • unique_names are determined for internal variables.

When testing:

  • Need to clean global object when doing dict_round_trip (as_dict and from_dict) tests
  • Need to sort the produced data dict when doing as_dict and from_dict tests
  • Changes to the produced unit
  • Not sure if parameterized tests are stable when the global object is cleaned

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['chore', 'fix', 'bugfix', 'bug', 'enhancement', 'feature', 'dependencies', 'documentation']

@andped10 andped10 added the chore Chore changes to the code label Aug 20, 2024
Copy link
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

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

This seems to look OK, I had several general questions, but nothing prohibiting from the merge.

super().__init__(name, interface, *models, **kwargs)
self.interface = interface

# Needed by the as_dict functionality
self.populate_if_none = False
Copy link
Member

Choose a reason for hiding this comment

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

there's no description of this boolean. Why is it needed in as_dict?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added code comment:
# Needed to ensure an empty list is created when saving and instatiating the object as_dict -> from_dict
# Else collisions might occur in global_object.map

'thickness': self.thickness,
'discretisation_elements': self._discretisation_elements,
'thickness': float(self.thickness),
'discretisation_elements': int(self._discretisation_elements),
Copy link
Member

Choose a reason for hiding this comment

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

why are those explicit coversions needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PR response
These are properties that else appears weird in the dictionary

@andped10 andped10 merged commit 38cae38 into develop Aug 29, 2024
26 checks passed
@andped10 andped10 deleted the easyscience-new-fitting-and-parameter branch August 29, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore changes to the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants