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

Boilerplate code to support object sorting and load/save needs better solution #356

Open
tgperring opened this issue Apr 29, 2021 · 0 comments
Assignees

Comments

@tgperring
Copy link
Collaborator

Many classes contain the same code for storing and retrieving independent property names (e.g. static method 'propNamesIndep_' and public method 'structIndep') and public property names. Additionally they have generic gateways ('saveobj', 'loadobj') to customised save and load methods that overload the Matlab defaults. The property access methods exist to provide fast object sorting (without them the generic methods such as sortStruct are very slow as calling the Matlab intrinsic metaclass methods each time an object is being enquired of dominates sorting.

The problem is that this block of routines ( a couple of hundred lines across propNamesIndep_, propNamesPublic_, scalarEmptyStructIndep_, scalarEmptyStructPublic_, structIndep, structArrIndep, structPublic, structArrPublic, saveobj, loadobj) is currently just cut-and-paste across numerous Herbert classes and possbily some Horace objects. This makessome core methods vulnerable to divergence should they ever need to be edited.

An alternative solution needs to be implemented that assures they are are common e.g. inheritance. They will allow more sophisticated object manipulations if they are implemented in other classes as they allow the notion of 'greater than' to be implemented that permits sorting and creating unique lists.

@abuts abuts self-assigned this Oct 11, 2021
abuts added a commit that referenced this issue Oct 12, 2021
…omplete

IX_aperture class is taken as example of future serializable  object
abuts added a commit that referenced this issue Oct 14, 2021
…sion.

Started to modify IX_aperture tests to use serializable
abuts added a commit that referenced this issue Oct 18, 2021
abuts added a commit that referenced this issue Oct 20, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 24, 2021
abuts added a commit that referenced this issue Oct 25, 2021
…hrough loadobj method.

and fix test_mpi_wrappers unit tests
abuts added a commit that referenced this issue Oct 25, 2021
…tion

in a future, we should avoid saving pdf table?
abuts added a commit that referenced this issue Oct 25, 2021
abuts added a commit that referenced this issue Oct 26, 2021
Modifie equal_to_tol.m to allow throwing exceptions on request
abuts added a commit that referenced this issue Oct 26, 2021
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
…e.m and disabling C++ tests and serialize_size test
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
…ake it serializable looks more complex then one can think
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
…ake it serializable through loadobj method.

and fix test_mpi_wrappers unit tests
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
…ent not its serialization

in a future, we should avoid saving pdf table?
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
…ture, found in a wild

Modifie equal_to_tol.m to allow throwing exceptions on request
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
… method

IX_experiment got empty constructor as input
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
…classes.

Made IX_source serializable (was not well serializable by default)
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
mducle pushed a commit to pace-neutrons/Horace that referenced this issue Jun 16, 2022
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