Skip to content

Commit

Permalink
Remove Michael's password from default config file
Browse files Browse the repository at this point in the history
- Also make it easier to run fibad commands by using ./fibad_config.toml
  as the user-supplied config in situations where no config is specified
  explicitly
  • Loading branch information
mtauraso committed Aug 27, 2024
1 parent 79293c8 commit 8ecc563
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/fibad/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import toml

DEFAULT_CONFIG_FILEPATH = Path(__file__).parent.resolve() / "fibad_default_config.toml"
DEFAULT_USER_CONFIG_FILEPATH = Path.cwd() / "fibad_config.toml"


def get_runtime_config(
Expand Down Expand Up @@ -38,6 +39,10 @@ def get_runtime_config(
with open(default_config_filepath, "r") as f:
default_runtime_config = toml.load(f)

# If a named config exists in cwd, and no config specified on cmdline, use cwd.
if runtime_config_filepath is None and DEFAULT_USER_CONFIG_FILEPATH.exists():
runtime_config_filepath = DEFAULT_USER_CONFIG_FILEPATH

Check warning on line 44 in src/fibad/config_utils.py

View check run for this annotation

Codecov / codecov/patch

src/fibad/config_utils.py#L44

Added line #L44 was not covered by tests

if runtime_config_filepath is not None:
if not runtime_config_filepath.exists():
raise FileNotFoundError(f"Runtime configuration file not found: {runtime_config_filepath}")
Expand Down
6 changes: 2 additions & 4 deletions src/fibad/fibad_default_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ sh = "22asec"
filter = ["HSC-G", "HSC-R", "HSC-I", "HSC-Z", "HSC-Y"]
type = "coadd"
rerun = "pdr3_wide"
username = "mtauraso@local"
password = "cCw+nX53lmNLHMy+JbizpH/dl4t7sxljiNm6a7k1"
max_connections = 2
fits_file = "../hscplay/temp.fits"
cutout_dir = "../hscplay/cutouts/"
fits_file = "./catalog.fits"
cutout_dir = "./data"
offset = 0
num_sources = 500

Expand Down

0 comments on commit 8ecc563

Please sign in to comment.