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

Readme and example not accurate #61

Closed
eimrek opened this issue Jul 2, 2024 · 0 comments · Fixed by #62
Closed

Readme and example not accurate #61

eimrek opened this issue Jul 2, 2024 · 0 comments · Fixed by #62

Comments

@eimrek
Copy link
Contributor

eimrek commented Jul 2, 2024

Hi @dou-du

Since moving to anywidget, i changed the python interface to reflect the underlying javascript code, see

class BandsPlotWidget(anywidget.AnyWidget):
_esm = pathlib.Path(__file__).parent / "static" / "widget.js"
_css = pathlib.Path(__file__).parent / "static" / "widget.css"
bands = tl.List([]).tag(sync=True)
dos = tl.Dict().tag(sync=True)
energy_range = tl.List([-10.0, 10.0]).tag(sync=True)
dos_range = tl.List([]).tag(sync=True)
bands_color = tl.List([]).tag(sync=True)
# Formatting settings:
# * showFermi
# * showLegend
# * bandsYlabel
format_settings = tl.Dict({}).tag(sync=True)
def __init__(
self,
**kwargs,
):
"""The traitlets defined above are possible kwargs."""
super().__init__(**kwargs)

E.g. plot_fermilevel and show_legend are now inside the format_settings dict.

More precisely:

  • The current example notebook and the readme are out of date.

  • Additionally, the readme states that we use a JSON schema for the PDOS, but that is not true any more.

  • The demo gif is also outdated. it might confuse users that don't get the same visual output. But perhaps it's fine to keep.

  • In general, i think it doesn't make sense to duplicate the usage examples in the README and also in the example notebook. it just a burden to keep the synchronized. But i'm not strongly opposed to it.

  • Also i think the extra information in the example notebook could be reduced considerably, e.g. it doesn't make sense to first write in the markdown about

    with open('./data/Si_bands.json', 'r') as file:
        band_Si = json.load(file)

    if the same code is executed in the notebook below.

dou-du pushed a commit that referenced this issue Jul 17, 2024
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 a pull request may close this issue.

1 participant