Deltares / imod-python

🐍🧰 Make massive MODFLOW models
https://deltares.github.io/imod-python/
MIT License
17 stars 3 forks source link

ValidationErrors in NestedStatusInfo: use four spaces instead of tabs? #914

Open Huite opened 5 months ago

Huite commented 5 months ago

I'm currently getting errors like this:

Simulation validation status:
    * GWF_1 model:
        * riv-2 package:
            * bottom_elevation:
                * not all values comply with criterion: > bottom
        * riv-3 package:
            * bottom_elevation:
                * not all values comply with criterion: > bottom
        * riv-4 package:
            * bottom_elevation:
                * not all values comply with criterion: > bottom

Since we're living in Python land, why not use four spaces?

Simulation validation status:
    * GWF_1 model:
        * riv-2 package:
            * bottom_elevation:
                * not all values comply with criterion: > bottom
        * riv-3 package:
            * bottom_elevation:
                * not all values comply with criterion: > bottom
        * riv-4 package:
            * bottom_elevation:
                * not all values comply with criterion: > bottom

I'm not entirely sure why so much space is generated by tabs; an advantage of ordinary spaces is that they're more predictable I guess.

I'm also noticing the asterisks look a bit noisy. If I compare:

Simulation validation status:
    GWF_1 model:
        riv-2 package:
            bottom_elevation:
                not all values comply with criterion: > bottom
        riv-3 package:
            bottom_elevation:
                not all values comply with criterion: > bottom
        riv-4 package:
             bottom_elevation:
                not all values comply with criterion: > bottom

We did choose them for a reason to clearly identify lists, but do the lines ever flow over to the next line?

I tried dashes, maybe a little better(?):

Simulation validation status:
    - GWF_1 model:
        - riv-2 package:
            - bottom_elevation:
                - not all values comply with criterion: > bottom
        - riv-3 package:
            - bottom_elevation:
                - not all values comply with criterion: > bottom
        - riv-4 package:
             - bottom_elevation:
                - not all values comply with criterion: > bottom
JoerivanEngelen commented 5 months ago

I agree that changing tabs to a fixed amount of spaces improves matters. I'd like to preserve a symbol to indicate separate elements: This helps distinguishing messages in the case a user's terminal folds long lines into multilines.

image

The dashes are slightly less noisy, so I'm fine switching from asterisks to dashes. No strong opinions on that