Skip to content

Commit

Permalink
Merge pull request #1087 from dirac-institute/minor-clean-up-issues-r…
Browse files Browse the repository at this point in the history
…elated-to-including-the-config-file-data-classes

Minor clean up issues related to including the config file data classes
  • Loading branch information
Little-Ryugu authored Jan 9, 2025
2 parents 27da25f + 39696e3 commit 2a6c51c
Show file tree
Hide file tree
Showing 19 changed files with 467 additions and 1,434 deletions.
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

0 comments on commit 2a6c51c

Please sign in to comment.