LSSTDESC / RESSPECT

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.
MIT License
1 stars 0 forks source link

Reading and Writing Features Refactor #78

Closed maxwest-uw closed 1 week ago

maxwest-uw commented 2 weeks ago

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

Reading Features from Files

Before submitting Please check the following: