janosh / pymatviz

A toolkit for visualizations in materials informatics.
https://janosh.github.io/pymatviz
MIT License
176 stars 16 forks source link

Split `make_assets` scripts by plot function #245

Closed janosh closed 1 week ago

janosh commented 1 week ago

Currently, make_assets scripts are named after the file whose plot function they import and demo. i think it would be better to split those scripts into one demo file per plot function. would make it easier to check that each plot function has at least 2 or 3 examples. it would also allow linking from the readme table directly to the examples we have for each function. right now, the readme table instead links to the source code which is less helpful

@DanielYang59 is this something you're interested in?

DanielYang59 commented 1 week ago

Sure I would do that (was looking into the asset maker seconds ago for the isotopes in pymatgen Element which I mentioned in one pymatviz comment somewhere). That would make assert maker much easier to access (I was having a hard time trying to find the corresponding assert maker almost every time).

DanielYang59 commented 1 week ago

And I was thinking about this seconds before you opened this issue: what about moving make_assets under assets instead of examples as we're linking to it anyway.

I found myself going to asset directory to look for the scripts almost every time 🙈

janosh commented 1 week ago

what about moving make_assets under assets instead of examples as we're linking to it anyway.

i view them more for the user's benefit than purely as dev code which is why i put them in examples/ originally. that said, i suppose it would be more useful to users if they were jupyter notebooks with the generated figures displayed inline which makes much easier to associate code with output. we could put the scripts in assets/ and convert them to notebooks for the docs site on the fly

DanielYang59 commented 1 week ago

Understood, that's the reason I propose this here, after we link those examples figures to their own asset makers, we could now relocate scripts under asset/ without worrying about discoverability.