-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Issue
We currently have a fairly unusual / non-standard approach to managing and accessing package data / resources (e.g. like yaml files containing mapping config files - solar_project_mapping.yaml etc).
These are are currently essentially in separate top level package (isp_trace_name_mapping_configs) and accessed using Path(__file__).parent.parent. This which but isn't the canonical approach for package data (and is a little fragile, might break / not work in certain install environments).
Possible solutions
I would suggest moving the mappings into the main package - something like:
src/isp_trace_parser/
└── mappings/
├── init.py
└── *.yamlThen use importlib.resources for loading:
from importlib.resources import files
trace_name_mappings = files("isp_trace_parser.mappings")(or something similar / more explicit as necessary)
Which I think follows standard conventions better (and will work better across different install environments / types).
Semi relates to #33 (with respect to how/where the scenario name mappings are).