Use AtomsSystems instead of FlexibleSystem for more features #21
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.
The main update is that the old
FlexibleSystemadditions are removed and AtomsSystems structures are used. Most of the utils used in AtomsBuilders are implemented in AtomsSystems and thus using them is better than maintaining them here.This update does not change how crystals are build. The only changes are use AtomsSystems structures and removing utilities that are now implemented in AtomsSystems.
Changes
repeat
repeatis defined in Julia.Base and use of it here forFlexibleSystemis type piracy (neitherrepeatorFlexibleSystemis defined in AtomsBuilder), so I removed it. AtomsSystem hasrepeatdefined for its structures and is thus not type piracy.The short cut of using
*for repeat e.g.bulk(:Cu) * 3does not work. This kind of use was discussed duringAtomsSystemsreview process and was dropped due to ambiguity. It would also be type piracy to implement it in AtomsBuilder.This is the biggest change and thus needs a major version bump.
rattle
AtomsSystems has
rattle_positionsimplemented withAtomsBase.set_position!and thus works with all AB structures that implement the given command.Note that AtomsSystems command uses
_positionssuffix. This is more explicit and gives room for futurerattle_cellcommand etc.union
Combine two systems with union is problematic, firstly it is type piracy and secondly it can have unexpected results due to general nature of union (it has implementations for iterators etc.). Thus AtomsSystems uses
add_systemsfunction to be more explicit and avoid other issuesrandz!
randz!works as usual, but now usesrandom_species!on the background.random_species!usesStatsBase.samplefor more control on sampling and is an additional implementation in AtomsBuilder. It can be used in the following way