Skip to content

ENH: "local" config file upward lookup #3953

@neutrinoceros

Description

@neutrinoceros

Bug report

Bug summary

Since yt 4.0 we support two locations to store a configuration file yt.toml, namely $XDG_CONFIG/yt/yt.toml (this is the global configuration) and ./yt.toml (local)

Now, assuming a data exploration project organised into subfolders, for instance

.
├── scripts
│   ├── exp1
│   │   ├── t1.py
│   │   ├── t2.py
│   │   └── t3.py
│   └── exp2
│       ├── t1.py
│       ├── t2.py
│       └── t3.py
└── yt.toml

The results of any script will differ depending on wether it's launched from the top level of the project (where yt.toml lives) or from within their respective containing directories.

To solve this, we could implement an upward lookup routine to check for yt.toml files in all parents directories until it is found (or we reach root /).

There is a precedent to the proposed behaviour: many tools already implement this mechanism, for instance

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementMaking something betterproposalProposals for enhancements, changes, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions