Open pfebrer opened 1 week ago
Attention: Patch coverage is 31.78295%
with 88 lines
in your changes missing coverage. Please review.
Project coverage is 86.93%. Comparing base (
49d4398
) to head (f4bd621
).
Files | Patch % | Lines |
---|---|---|
src/sisl/cli/sdata.py | 0.00% | 68 Missing :warning: |
src/sisl/io/siesta/eig.py | 22.22% | 14 Missing :warning: |
src/sisl/data/data.py | 75.00% | 4 Missing :warning: |
src/sisl/data/_singledispatch.py | 93.75% | 1 Missing :warning: |
src/sisl/data/dos.py | 88.88% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
As discussed with Nick, this is a minimal first attempt for the automatic generation of a CLI to postprocess data.
The aim is to organize things in a way that new methods to generate data can be simply registered to data classes and automatically added to the CLI, without needing to maintain CLI options all across sisl.
The automatic generation of a CLI requires of course some boilerplate code, but the amount of boilerplate code is almost constant when we add new functionality.
The approach taken:
sisl.data
that should help gathering all the possible ways in which the same data can be generated. For now I only implementedDOSData
.DOSData
fromeigSileSiesta
. This functions should be type annotated to be automatically supported by the CLI.sisl.cli.sdata
. For now it can be ran withpython -m sisl.cli.sdata
. That file is hyper documented, and there I explain all the parts that play a role in generating the CLI.This standarization should not only help to create sisl's CLI but also facilitate the creation of other interfaces to sisl down the line (including the GUI).
To use it, for now, you need to install
nodify
's dev version,click
andrich_click
:The CLI can work in two ways:
Specify the type of data that you want and how to get it.
Main:![Screenshot from 2024-06-26 23-21-16](https://github.com/zerothi/sisl/assets/42074085/78963dc5-60d2-4137-beec-25b923b1d3aa)
DOS data:![Screenshot from 2024-06-26 23-20-46](https://github.com/zerothi/sisl/assets/42074085/e5de4462-793c-40f7-b1e2-971c72048e01)
DOS data from the EIG file:![Screenshot from 2024-06-26 23-20-56](https://github.com/zerothi/sisl/assets/42074085/b015754d-3c79-4096-90d4-0a152d524562)
Pass a file, then only specify which data you want to get
Main:![Screenshot from 2024-06-26 23-24-25](https://github.com/zerothi/sisl/assets/42074085/f2dcbea8-f87a-49b7-ad64-d9a2736a6472)
DOS data:![Screenshot from 2024-06-26 23-25-38](https://github.com/zerothi/sisl/assets/42074085/6817dc40-8c87-4f89-9ddd-61e111ecb681)