From 4110205b491f33627b9b7c0ad8843ad2d4e1c5fd Mon Sep 17 00:00:00 2001 From: awongel Date: Thu, 29 Feb 2024 13:53:52 -0800 Subject: [PATCH] Modifications needed because of changed name of repo --- README.md | 8 ++++---- env.yaml | 2 +- utilities/read_input.py | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f9af1fe..f7b2b81 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,11 @@ Costs and other technology inputs can be read in from the [PyPSA technology data with --recursive (this clones PyPSA as a submodule ) -```git clone https://github.com/carnegie/clab_pypsa --recursive``` +```git clone https://github.com/carnegie/table_pypsa --recursive``` -which creates a directory `clab_pypsa`, cd into that director with +which creates a directory `table_pypsa`, cd into that director with -```cd clab_pypsa``` +```cd table_pypsa``` # ## Install dependencies in the environment @@ -60,7 +60,7 @@ If you're running for the first time, create the environment with Then activate the environment with -```conda activate pypsa_table``` +```conda activate table_pypsa_env``` **every time** you want this code. diff --git a/env.yaml b/env.yaml index af33129..60efe0f 100644 --- a/env.yaml +++ b/env.yaml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: MIT # Based on https://github.com/PyPSA/pypsa-eur/blob/master/envs/environment.yaml -name: pypsa_table +name: table_pypsa_env channels: - conda-forge diff --git a/utilities/read_input.py b/utilities/read_input.py index 6b3cf52..a9e0919 100644 --- a/utilities/read_input.py +++ b/utilities/read_input.py @@ -236,17 +236,17 @@ def read_input_file_to_dict(file_name): # Config file path cwd = Path.cwd() - if cwd.parts[-1] == 'clab_pypsa': + if cwd.parts[-1] == 'table_pypsa': config_file_path = str(cwd / 'utilities' / 'cost_config.yaml') # for local or Github action - # note in GitHub action the cwd is /home/runner/work/clab_pypsa/clab_pypsa - elif (cwd / 'clab_pypsa').is_dir(): # we're above the clab_pypsa dir - config_file_path = str(cwd / 'clab_pypsa' / 'utilities' / 'cost_config.yaml') - elif 'clab_pypsa' in cwd.parts: # in case we're running an executable in clab_pypsa/dist/run_pypsa via PyInstaller exe - clab_pypsa_index = cwd.parts.index('clab_pypsa') - path_to_clab_pypsa = Path(*cwd.parts[:clab_pypsa_index+1]) - config_file_path = str(path_to_clab_pypsa / 'utilities' / 'cost_config.yaml') + # note in GitHub action the cwd is /home/runner/work/table_pypsa/table_pypsa + elif (cwd / 'table_pypsa').is_dir(): # we're above the table_pypsa dir + config_file_path = str(cwd / 'table_pypsa' / 'utilities' / 'cost_config.yaml') + elif 'table_pypsa' in cwd.parts: # in case we're running an executable in table_pypsa/dist/run_pypsa via PyInstaller exe + table_pypsa_index = cwd.parts.index('table_pypsa') + path_to_table_pypsa = Path(*cwd.parts[:table_pypsa_index+1]) + config_file_path = str(path_to_table_pypsa / 'utilities' / 'cost_config.yaml') else: - logging.error('Current directory is not clab_pypsa and clab directory is not in current directory.') + logging.error('Current directory is not table_pypsa and clab directory is not in current directory.') # Load PyPSA costs costs = load_costs(tech_costs=case_data_dict["costs_path"], config=config_file_path, Nyears=nyears)