-
Notifications
You must be signed in to change notification settings - Fork 2
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
Introducing state #11
Changes from 2 commits
ba77e76
568b0df
a9be1c4
f3f960c
7c672e4
15876d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module AtomsCalculators | ||
|
||
export AbstractCalculator | ||
|
||
|
||
using AtomsBase | ||
using StaticArrays | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
|
||
abstract type AbstractCalculator end | ||
|
||
struct DummyState end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
calculator_state(::AbstractCalculator) = DummyState() | ||
update_state(::Any, ::DummyState, ::Any, ::Any) = DummyState() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use calculator_internal_state(::Any) = missing
update_calculator_state(
update_algorithm::Any,
initial_internal_state::Missing,
initial_state::Any,
new_state::Any
) = missing # return new internal state I would also add documentation on why to do this. Also, You will potentially call the command with different calculator types (e.g. when comparing different methods) and this causes errors, if algorithm in not defined for both of them. You could ignore algorithm all together to solve this. But this then goes on to the question, why it is there in the first place? |
||
|
||
struct Energy end | ||
struct Forces end | ||
struct Virial end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add
AbstractCalculator
type. It is not needed and it's presence will cause a lot of problems.