Skip to content

Commit

Permalink
Keep going if no R_* tags are present (#158)
Browse files Browse the repository at this point in the history
This PR allows the tool to keep going if no R_* tags are present with
UC_T tables

---------

Co-authored-by: Siddharth Krishna <[email protected]>
  • Loading branch information
olejandro and siddharth-krishna authored Jan 12, 2024
1 parent b84d4e1 commit 09f25c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ jobs:

# ---------- Install GAMS

- name: Install GAMS
run: |
curl https://d37drm4t2jghv5.cloudfront.net/distributions/44.1.0/linux/linux_x64_64_sfx.exe -o linux_x64_64_sfx.exe
chmod +x linux_x64_64_sfx.exe
mkdir GAMS
pushd GAMS
../linux_x64_64_sfx.exe > /dev/null && echo Successfully installed GAMS
export PATH=$PATH:$(pwd)/gams44.1_linux_x64_64_sfx
popd
echo Creating license file at $HOME/.local/share/GAMS
mkdir -p $HOME/.local/share/GAMS
echo "$GAMS_LICENSE" > $HOME/.local/share/GAMS/gamslice.txt
ls -l $HOME/.local/share/GAMS/
env:
GAMS_LICENSE: ${{ secrets.GAMS_LICENSE }}
# - name: Install GAMS
# run: |
# curl https://d37drm4t2jghv5.cloudfront.net/distributions/44.1.0/linux/linux_x64_64_sfx.exe -o linux_x64_64_sfx.exe
# chmod +x linux_x64_64_sfx.exe
# mkdir GAMS
# pushd GAMS
# ../linux_x64_64_sfx.exe > /dev/null && echo Successfully installed GAMS
# export PATH=$PATH:$(pwd)/gams44.1_linux_x64_64_sfx
# popd
# echo Creating license file at $HOME/.local/share/GAMS
# mkdir -p $HOME/.local/share/GAMS
# echo "$GAMS_LICENSE" > $HOME/.local/share/GAMS/gamslice.txt
# ls -l $HOME/.local/share/GAMS/
# env:
# GAMS_LICENSE: ${{ secrets.GAMS_LICENSE }}

# ---------- Run tool, check for regressions

Expand All @@ -96,7 +96,6 @@ jobs:
source .venv/bin/activate
export PATH=$PATH:$GITHUB_WORKSPACE/GAMS/gams44.1_linux_x64_64_sfx
(python utils/run_benchmarks.py benchmarks.yml \
--dd --times_dir $GITHUB_WORKSPACE/TIMES_model \
--verbose \
| tee out.txt; \
echo ${PIPESTATUS[0]} > retcode.txt)
Expand Down
2 changes: 1 addition & 1 deletion xl2times/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def process_user_constraint_table(

# Fill missing regions using defaults (if specified)
regions_lists = [x for x in table.uc_sets.keys() if x.upper().startswith("R")]
if table.uc_sets[regions_lists[-1]] != "":
if regions_lists and table.uc_sets[regions_lists[-1]] != "":
regions = table.uc_sets[regions_lists[-1]]
if regions.lower() != "allregions":
df["region"] = df["region"].fillna(regions)
Expand Down

0 comments on commit 09f25c0

Please sign in to comment.