Change atomic_types
and gradients
from Sets to Unique Lists
#296
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request changes the types of the
atomic_types
andgradients
properties in theDatasetInfo
andTargetInfo
classes from sets to (unique) lists.These properties were originally designed as sets because they represent collections of unique items. However, @frostedoyster raised constant concerns about the difficulty from him working with sets in certain contexts, particularly with functions and classes that expect lists. This change aims to resolve those issues.
The
atomic_types
andgradients
are still stored internally as sets to maintain uniqueness, but they are exposed as sorted lists for compatibility. This change has introduced additional methods and complexity to the classes which can be easily seen by number of added lines in this PR. For instance, the code had to be adjusted in various places, such as changing:to a much more nested style
I must express that I am very unhappy with these changes. I think changing the types is very bad design choice. The properties
atomic_types
andgradients
should clearly be sets due to their nature of representing unique items. Lists do not have these properties. This change, in my opinion, compromises the clarity and integrity of the code. However, I have made these changes to accommodate the concerns raised and to facilitate smoother development.@frostedoyster, please review these changes to ensure that they fix your issues in #286. I expect that you (1) add a clear and not messy test in this PR to ensure that your log files are rendered in exactly the order you want them. (2) I encourage you to also to check and add a test for the continuation of your SOAP BPNN model when changing types. Scrolling through your test in
test_continue.py
, I saw no tests checking this functionality...Contributor (creator of pull-request) checklist
📚 Documentation preview 📚: https://metatrain--296.org.readthedocs.build/en/296/