The RESSPECT project is a result from an inter-collaboration agreement established between the Cosmostatistics Initiative (COIN) and the LSST Dark Energy Science Collaboration (DESC) with the goal of developing a recommendation system for telescope resource allocation able to optimize photometric supernova cosmology anaylsis.
Refactor the reading and writing of features to files to call to a single utility. Right now, the code to do this is scattered all over the RESSPECT codebase, so to prepare for changes when it comes to data storage (i.e. connecting to MongoDB) we need to ensure that we have a standardized way of handling feature data i/o.
Suggested Solution
Since we want to be able to keep the .csv reading for the time being, we should have a utility function like
def save_features(data, location, filename=None, extractor="Malanchev"):
if location is "filesystem":
_write_features_to_file(data, filename)
elif location is "mongodb":
_save_features_to_mongodb(data, extractor)
...
Writing Features to Files
[x] fit_lightcurves.py
[x] write_features_to_output_file
and everywhere in that file that calls it
[x] time_domain_plasticc.py
[x] _maybe_write_feature_to_file
[x] _maybe_create_daily_feature_files
[ ] time_domain_plasticc.py
[ ] create_daily_file
Reading Features from Files
[x] database.py
[x] load_features_from_file
[x] load_photometry_features (?)
[x] load_features.py
[x] load_features
[x] called a few times
[x] time_domain_loop.py
[x] load_dataset
[x] calls database.load_features
Before submitting
Please check the following:
[x] I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
[x] I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
[x] If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.
Refactor the reading and writing of features to files to call to a single utility. Right now, the code to do this is scattered all over the RESSPECT codebase, so to prepare for changes when it comes to data storage (i.e. connecting to MongoDB) we need to ensure that we have a standardized way of handling feature data i/o.
Suggested Solution
Since we want to be able to keep the
.csv
reading for the time being, we should have a utility function likeWriting Features to Files
fit_lightcurves.py
write_features_to_output_file
time_domain_plasticc.py
_maybe_write_feature_to_file
_maybe_create_daily_feature_files
time_domain_plasticc.py
create_daily_file
Reading Features from Files
database.py
load_features_from_file
load_photometry_features
(?)load_features.py
load_features
time_domain_loop.py
load_dataset
database.load_features
Before submitting Please check the following: