zerothi / sisl

Electronic structure Python package for post analysis and large scale tight-binding DFT/NEGF calculations
https://zerothi.github.io/sisl
Mozilla Public License 2.0
173 stars 57 forks source link

First try at automated data CLI #801

Open pfebrer opened 1 week ago

pfebrer commented 1 week ago

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:

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 and rich_click:

pip install git@github.com:pfebrer/nodify.git click rich_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

DOS data: Screenshot from 2024-06-26 23-20-46

DOS data from the EIG file: Screenshot from 2024-06-26 23-20-56

Pass a file, then only specify which data you want to get

Main: Screenshot from 2024-06-26 23-24-25

DOS data: Screenshot from 2024-06-26 23-25-38

codecov[bot] commented 1 week ago

Codecov Report

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:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #801 +/- ## ========================================== - Coverage 87.07% 86.93% -0.14% ========================================== Files 400 405 +5 Lines 51657 51785 +128 ========================================== + Hits 44978 45018 +40 - Misses 6679 6767 +88 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.