Skip to content

setup path with default and read from environment #2

@matbesancon

Description

@matbesancon

specifically in HVAC2.py

############################################################################
# Setup

DATA_PATH = "PATH_TO_PYDR_DATA"
LOG_PATH = "PATH_TO_LOGS"
RESULTS_PATH = "PATH_TO_RESULTS"

This could be replaced by

import os
DATA_PATH = os.environ["DATA_PATH"]
LOG_PATH = os.environ["LOG_PATH"]
RESULTS_PATH = os.environ["RESULTS_PATH"]

If the folders are usually located to some given place relative to the current folder:

import pathlib
root_path = pathlib.Path().absolute().joinpath("..")
# DATA_PATH = .. something relative to root_path

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions