Skip to content

Commit

Permalink
Modifications needed because of changed name of repo
Browse files Browse the repository at this point in the history
  • Loading branch information
awongel committed Feb 29, 2024
1 parent 8ce2a02 commit 4110205
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions utilities/read_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4110205

Please sign in to comment.