Skip to content

Commit

Permalink
should be a public method
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-mendoza committed Nov 14, 2021
1 parent a4cc1a0 commit 1578285
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions btk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from btk.measure import available_measure_functions
from btk.measure import MeasureGenerator
from btk.metrics import MetricsGenerator
from btk.survey import _get_survey_from_cfg
from btk.survey import get_survey_from_cfg


def main(cfg: OmegaConf):
"""Run BTK from end-to-end using a hydra configuration object."""
surveys = [_get_survey_from_cfg(cfg.surveys[survey_name]) for survey_name in cfg.surveys]
surveys = [get_survey_from_cfg(cfg.surveys[survey_name]) for survey_name in cfg.surveys]

# get draw blends generator.
draw_blend_generator = instantiate(cfg.draw_blends, surveys=surveys)
Expand Down
4 changes: 2 additions & 2 deletions btk/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
extinction (float): Exponential extinction coefficient for atmospheric absorption"""


def _get_survey_from_cfg(survey_conf: OmegaConf):
def get_survey_from_cfg(survey_conf: OmegaConf):
"""Creates the corresponding `btk.survey.Survey` object using the information from config file.
Args:
Expand Down Expand Up @@ -129,7 +129,7 @@ def get_surveys(names="Rubin", overrides: Iterable = ()):
cfg = compose("config", overrides=overrides)
for survey_name in cfg.surveys:
survey_conf = cfg.surveys[survey_name]
surveys.append(_get_survey_from_cfg(survey_conf))
surveys.append(get_survey_from_cfg(survey_conf))
if len(surveys) == 1:
return surveys[0]
return surveys
Expand Down

0 comments on commit 1578285

Please sign in to comment.