def build_from_time(subject_id, valid_epochs):

        circadian_feature = TimeBasedFeatureService.build_circadian_model(subject_id, valid_epochs)
        cosine_feature = TimeBasedFeatureService.build_cosine(valid_epochs)
        time_feature = TimeBasedFeatureService.build_time(valid_epochs)

        TimeBasedFeatureService.write_circadian_model(subject_id, circadian_feature)
        TimeBasedFeatureService.write_cosine(subject_id, cosine_feature)
        TimeBasedFeatureService.write_time(subject_id, time_feature)
    def test_write_circadian_model(self, mock_np):
        feature_to_write = np.array([1, 2, 3, 4])
        subject_id = "subjectA"
        TimeBasedFeatureService.write_circadian_model(subject_id,
                                                      feature_to_write)

        mock_np.savetxt.assert_called_once_with(
            TimeBasedFeatureService.get_path_for_circadian_model(subject_id),
            feature_to_write,
            fmt='%f')
    def build_from_time(subject_id, valid_epochs):

        if Constants.INCLUDE_CIRCADIAN:
            circadian_feature = TimeBasedFeatureService.build_circadian_model(
                subject_id, valid_epochs)
            TimeBasedFeatureService.write_circadian_model(
                subject_id, circadian_feature)

        cosine_feature = TimeBasedFeatureService.build_cosine(valid_epochs)
        time_feature = TimeBasedFeatureService.build_time(valid_epochs)

        TimeBasedFeatureService.write_cosine(subject_id, cosine_feature)
        TimeBasedFeatureService.write_time(subject_id, time_feature)