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

Key-based property interface #61

Merged
merged 6 commits into from
Jan 19, 2023
Merged

Key-based property interface #61

merged 6 commits into from
Jan 19, 2023

Conversation

mfherbst
Copy link
Member

@mfherbst mfherbst commented Dec 26, 2022

Extension of the implementation discussed in #56. Applied on top of the changes made in #58, which should be merged first.

Todos:

  • Adapt documentation

@mfherbst mfherbst force-pushed the newprop branch 2 times, most recently from eb5cdaa to 06e226e Compare January 2, 2023 18:56
@@ -55,16 +56,15 @@ end
function Atom(id::AtomId, position::AbstractVector, velocity::Missing; kwargs...)
Atom(id, position; kwargs...)
end
function Atom(; atomic_symbol, position, velocity=zeros(length(position))u"bohr/s", kwargs...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does this one set the default velocity to zero when the one above sets it to missing?

Copy link
Member Author

@mfherbst mfherbst Jan 19, 2023

Choose a reason for hiding this comment

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

Well actually the first catches the case where it is equal to missing and changes that to zero. I can make that more explicit.

In fact in my usage of AtomsBase the missing values often caused quite some annoyances (like duplicated code paths just to cover for the "missing" case). I'm almost convinced the better option would be to drop the missing idea (and just return zeros instead).

Copy link
Collaborator

@rkurchin rkurchin left a comment

Choose a reason for hiding this comment

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

Generally looks good – I put a few comments (I accidentally did them outside of this "review" so apologies if that muddles anything) raising some very minor things.

@mfherbst mfherbst enabled auto-merge (squash) January 19, 2023 19:28
@mfherbst mfherbst merged commit c820c36 into master Jan 19, 2023
@mfherbst mfherbst deleted the newprop branch January 19, 2023 19:29
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

Successfully merging this pull request may close these issues.

2 participants