lab-cosmo / chemiscope

An interactive structure/property explorer for materials and molecules
http://chemiscope.org
BSD 3-Clause "New" or "Revised" License
131 stars 32 forks source link

Stop automatically extracting properties from frames #248

Closed Luthaf closed 1 year ago

Luthaf commented 2 years ago

Instead, we provide functions to decide what properties one wants to extract

Code like this

chemiscope.input(
    frames=my_frames,
    properties=my_properties,
   ...
)

# only frame properties
chemiscope.input(
    frames=my_frames,
   ...
)

Should now be like this

frame_properties = chemiscope.extract_properties(my_frames)
my_properties.update(frame_properties)

chemiscope.input(
    frames=my_frames,
    properties=my_properties,
   ...
)

# only frame properties
chemiscope.input(
    frames=my_frames,
    properties=chemiscope.extract_properties(my_frames),
   ...
)

I think this makes the API less surprising/less magical, and make it easier for users to select a subset of properties out of the frames.

It also helps on the developer side by reducing the explosion of parameters, for example composition is now a separate function that users can decide to use or not. Similar function could compute a basic SOAP representation and project it in 2 dimensions for nicer integration with lib-rascal-ine, etc.

However, this is breaking enough to warrant a bit of discussion and releasing it in a new version (0.5) altogether.

ceriottm commented 2 years ago

Also, I suggest we aim to have jupyter-lab integration for 0.5 ^_^

Luthaf commented 2 years ago

Also, I suggest we aim to have jupyter-lab integration for 0.5 ^_^

Yes, that's my plan: this PR and jupyter-lab will go into 0.5