Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor clean up issues related to including the config file data classes #1087

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchmarks/bench_cProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pstats import SortKey
from sorcha.sorcha import runLSSTSimulation # noqa: F401
from sorcha.modules.PPConfigParser import PPConfigFileParser
from sorcha.utilities.sorchaConfigs import sorchaConfigs
from sorcha.utilities.sorchaArguments import sorchaArguments
import argparse

Expand Down Expand Up @@ -39,7 +39,7 @@

args_obj = sorchaArguments(cmd_args_dict)

configs = PPConfigFileParser(os.path.join(path_to_sorcha, "benchmarks/test_bench_config.ini"), "LSST")
configs = sorchaConfigs(os.path.join(path_to_sorcha, "benchmarks/test_bench_config.ini"), "LSST")

cProfile.run("runLSSTSimulation(args_obj, configs)", os.path.join(path_to_sorcha, "tests/out/restats"))

Expand Down
16 changes: 8 additions & 8 deletions src/sorcha/modules/PPCommandLineParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import logging
import glob
from .PPConfigParser import PPFindFileOrExit, PPFindDirectoryOrExit
from sorcha.utilities.fileAccessUtils import FindFileOrExit, FindDirectoryOrExit


def warn_or_remove_file(filepath, force_remove, pplogger):
Expand Down Expand Up @@ -58,14 +58,14 @@ def PPCommandLineParser(args):

cmd_args_dict = {}

cmd_args_dict["paramsinput"] = PPFindFileOrExit(args.p, "-p, --params")
cmd_args_dict["orbinfile"] = PPFindFileOrExit(args.ob, "-ob, --orbit")
cmd_args_dict["configfile"] = PPFindFileOrExit(args.c, "-c, --config")
cmd_args_dict["outpath"] = PPFindFileOrExit(args.o, "-o, --outfile")
cmd_args_dict["pointing_database"] = PPFindFileOrExit(args.pd, "-pd, --pointing_database")
cmd_args_dict["paramsinput"] = FindFileOrExit(args.p, "-p, --params")
cmd_args_dict["orbinfile"] = FindFileOrExit(args.ob, "-ob, --orbit")
cmd_args_dict["configfile"] = FindFileOrExit(args.c, "-c, --config")
cmd_args_dict["outpath"] = FindFileOrExit(args.o, "-o, --outfile")
cmd_args_dict["pointing_database"] = FindFileOrExit(args.pd, "-pd, --pointing_database")

if args.cp:
cmd_args_dict["complex_physical_parameters"] = PPFindFileOrExit(
cmd_args_dict["complex_physical_parameters"] = FindFileOrExit(
args.cp, "-cp, --complex_physical_parameters"
)

Expand Down Expand Up @@ -95,7 +95,7 @@ def PPCommandLineParser(args):

cmd_args_dict["ar_data_path"] = args.ar # default value for args.ar is `None`.
if cmd_args_dict["ar_data_path"]:
PPFindDirectoryOrExit(cmd_args_dict["ar_data_path"], "-ar, --ar_data_path")
FindDirectoryOrExit(cmd_args_dict["ar_data_path"], "-ar, --ar_data_path")

warn_or_remove_file(
os.path.join(cmd_args_dict["outpath"], cmd_args_dict["outfilestem"] + ".*"), args.f, pplogger
Expand Down
Loading
Loading