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

OO API #5

Open
dgasmith opened this issue Feb 22, 2020 · 0 comments
Open

OO API #5

dgasmith opened this issue Feb 22, 2020 · 0 comments

Comments

@dgasmith
Copy link

An API like the following can be awkward:

fig.add_molecule("QC", molecule=ammonia_dimer)
fig.add_molecule("xyz", file='bucky.xyz')

It is a bit overloaded in general and doesn't follow any common python pattern.

Consider always using the pattern add_x(name, object) where we would have:

fig.add_molecule("mol1", Molecule)
fig.add_molecule("mol2", Molecule.from_file('Bucky.xyz"))
fig.add_orbital("Orbital1", Wavefunction)

It bring in an interesting question if we have two contexts:

fig.add_measurement("measure1", "mol1", [0, 1, 2])
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

1 participant