Skip to content

Commit

Permalink
Merge pull request #156 from VTDA-Group/issue/24/datagen-cov
Browse files Browse the repository at this point in the history
Add no-covers to fns calling alerce and antares
  • Loading branch information
OliviaLynn authored Sep 26, 2023
2 parents 6dc9f47 + 0b0dc8b commit afe1de0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/superphot_plus/data_generation/alerce.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# pylint: disable=global-variable-not-assigned


def add_stamp_column(input_filename, output_filename):
def add_stamp_column(input_filename, output_filename): # pragma: no cover
"""Checks whether stamp classifier categorizes each lightcurve in
spreadsheet as a supernova-like transient, and adds as additional
column.
Expand Down Expand Up @@ -53,7 +53,7 @@ def add_stamp_column(input_filename, output_filename):
csv_writer.writerow([*row, "None"])


def get_all_unclassified_samples(save_csv):
def get_all_unclassified_samples(save_csv): # pragma: no cover
"""Get all unclassified samples and save them to a CSV file.
Parameters
Expand Down Expand Up @@ -122,7 +122,7 @@ def get_all_unclassified_samples(save_csv):
i += 1


def generate_flux_files(master_csv, save_folder):
def generate_flux_files(master_csv, save_folder): # pragma: no cover
"""Generates flux files for all ZTF samples in the master CSV file,
using ALeRCE's API.
Expand Down
10 changes: 5 additions & 5 deletions src/superphot_plus/data_generation/antares.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from superphot_plus.utils import convert_mags_to_flux


def generate_files_from_antares(input_csv, output_folder, output_csv): # pylint: disable=too-many-statements
def generate_files_from_antares(
input_csv, output_folder, output_csv
): # pylint: disable=too-many-statements; # pragma: no cover
"""Generates flux files for all ZTF samples in the master CSV file,
using ANTARES' API.
Expand Down Expand Up @@ -105,10 +107,8 @@ def generate_files_from_antares(input_csv, output_folder, output_csv): # pylint
flux_errors=ferr,
bands=b,
)

lc.save_to_file(
os.path.join(output_folder, ztf_name+".npz")
)

lc.save_to_file(os.path.join(output_folder, ztf_name + ".npz"))
add_to_new_csv(ztf_name, label, redshift, output_csv)

tally_each_class(label_dict)

0 comments on commit afe1de0

Please sign in to comment.