Skip to content

Commit

Permalink
Merge pull request #976 from mjuric/main
Browse files Browse the repository at this point in the history
Bug fixes for issues found while conda packaging
  • Loading branch information
mjuric authored Jul 11, 2024
2 parents 646bbf5 + 59102a5 commit d472a6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions demo/quicktest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@

set -e

trap '{ rm -f quicktest-result.csv; } ' EXIT
trap '{ rm -f quicktest-result.*; } ' EXIT

test -d demo || { echo "$0 must be run from the top-level source code directory"; exit -1; }

rm -f quicktest-result.csv
rm -f quicktest-result.*

sorcha bootstrap
sorcha run -c ./demo/sorcha_config_demo.ini -p ./demo/sspp_testset_colours.txt -ob ./demo/sspp_testset_orbits.des -pd ./demo/baseline_v2.0_1yr.db -o ./ -t quicktest-result
sorcha run -c ./demo/sorcha_config_demo.ini -p ./demo/sspp_testset_colours.txt -ob ./demo/sspp_testset_orbits.des -pd ./demo/baseline_v2.0_1yr.db -o ./ -t quicktest-result -st quicktest-result.stats

# check that the output file size is larger than ~10k
# (NOTE: this is just a rough check, we should test against known output here!)
filesize=$(wc -c quicktest-result.csv | awk '{print $1}')
test $filesize -gt 10000

# check that the stats file exists
test -f quicktest-result.stats.csv

echo "Quick test succesful!"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sorcha-run = "sorcha_cmdline.run:main"
sorcha-init = "sorcha_cmdline.init:main"
sorcha-demo = "sorcha_cmdline.demo:main"
sorcha-outputs = "sorcha_cmdline.outputs:main"
sorcha-boostrap = "sorcha_cmdline.bootstrap:main"
sorcha-bootstrap = "sorcha_cmdline.bootstrap:main"

[project.urls]
"Documentation" = "https://sorcha.readthedocs.io/en/latest/"
Expand Down
7 changes: 4 additions & 3 deletions src/sorcha/modules/PPCommandLineParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ def PPCommandLineParser(args):
cmd_args_dict["verbose"] = args.v
cmd_args_dict["stats"] = args.st

warn_or_remove_file(
os.path.join(cmd_args_dict["outpath"], cmd_args_dict["stats"] + ".csv"), args.f, pplogger
)
if cmd_args_dict["stats"] is not None:
warn_or_remove_file(
os.path.join(cmd_args_dict["outpath"], cmd_args_dict["stats"] + ".csv"), args.f, pplogger
)

cmd_args_dict["ar_data_path"] = args.ar # default value for args.ar is `None`.
if cmd_args_dict["ar_data_path"]:
Expand Down

0 comments on commit d472a6b

Please sign in to comment.