From e56273aded836e7e61a552175c45d50f8b676cda Mon Sep 17 00:00:00 2001 From: Mufaddal Naguthanawala Date: Thu, 16 Jan 2025 11:23:03 -0500 Subject: [PATCH] Add start and end date parameters to main --- src/bioregistry/analysis/paper_ranking.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bioregistry/analysis/paper_ranking.py b/src/bioregistry/analysis/paper_ranking.py index af5b010af..5cac84daa 100644 --- a/src/bioregistry/analysis/paper_ranking.py +++ b/src/bioregistry/analysis/paper_ranking.py @@ -396,10 +396,12 @@ def _get_evaluation_df( help="End date of the period", default=datetime.date.today().isoformat(), ) -def main(bioregistry_file: Path) -> None: +def main(bioregistry_file: Path, start_date: str, end_date: str) -> None: """Load data, train classifiers, evaluate models, and predict new data. :param bioregistry_file: Path to the bioregistry JSON file. + :param start_date: The start date of the period for which papers are being ranked. + :param end_date: The end date of the period for which papers are being ranked. """ runner( bioregistry_file=bioregistry_file, @@ -481,9 +483,9 @@ def runner( if not predictions_df.empty: # TODO update the way naming this file works, see discussion on # https://github.com/biopragmatics/bioregistry/pull/1350 - predictions_path = output_path.joinpath(f"predictions_{start_date}_to_{end_date}.tsv") + predictions_path = output_path.joinpath(f"predictions.tsv") predict_and_save(predictions_df, vectorizer, classifiers, meta_clf, predictions_path) if __name__ == "__main__": - main() + main() \ No newline at end of file