From 1dcf9495e6b86ae029bc9933a1f4523fddade759 Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Mon, 2 Oct 2023 22:33:39 +0200 Subject: [PATCH 1/2] Fixed #227 --- pephub/helpers.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pephub/helpers.py b/pephub/helpers.py index 34070f50..053a2a92 100644 --- a/pephub/helpers.py +++ b/pephub/helpers.py @@ -9,6 +9,7 @@ from yaml import safe_load import zipfile import io +import yaml import peppy from peppy.const import SAMPLE_DF_KEY @@ -130,20 +131,24 @@ def zip_pep(project: peppy.Project) -> Response: if project.config: prj_cof_file = project.config_file or "config.yaml" cfg_filename_base = basename(prj_cof_file) - content_to_zip[cfg_filename_base] = project.config.to_yaml() + content_to_zip[cfg_filename_base] = yaml.dump(project.config, indent=4) if project.sample_table is not None: sample_table_filename = basename( project.to_dict().get("sample_table", "sample_table.csv") ) - content_to_zip[sample_table_filename] = project[SAMPLE_DF_KEY].to_csv() + content_to_zip[sample_table_filename] = project[SAMPLE_DF_KEY].to_csv( + index=False + ) if project.subsample_table is not None: if not isinstance(project.subsample_table, list): subsample_table_filename = basename( project.to_dict().get("subsample_table", "subsample_table.csv") ) - content_to_zip[subsample_table_filename] = project.subsample_table.to_csv() + content_to_zip[subsample_table_filename] = project.subsample_table.to_csv( + index=False + ) else: subsample_table_filenames = project.to_dict().get( "subsample_table", "subsample_table.csv" @@ -152,7 +157,7 @@ def zip_pep(project: peppy.Project) -> Response: project.subsample_table, subsample_table_filenames ): subsample_table_filename = basename(sstable_filename) - content_to_zip[subsample_table_filename] = sstable.to_csv() + content_to_zip[subsample_table_filename] = sstable.to_csv(index=False) zip_filename = project.name or f"downloaded_pep_{date.today()}" return zip_conv_result(content_to_zip, filename=zip_filename) From 772f50d76ab4171a12b7d41e49290810b194009e Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Mon, 2 Oct 2023 22:41:10 +0200 Subject: [PATCH 2/2] changelog --- docs/changelog.md | 6 ++++++ pephub/_version.py | 2 +- requirements/requirements-all.txt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index dbff0948..dd448749 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. +# [0.10.4] - 10-02-2023 + +### Fixed + +- PEP zip downloading + # [0.10.3] - 08-31-2023 ### Changed diff --git a/pephub/_version.py b/pephub/_version.py index b2385cb4..d9b054ab 100644 --- a/pephub/_version.py +++ b/pephub/_version.py @@ -1 +1 @@ -__version__ = "0.10.3" +__version__ = "0.10.4" diff --git a/requirements/requirements-all.txt b/requirements/requirements-all.txt index ca405b5b..33d32f40 100644 --- a/requirements/requirements-all.txt +++ b/requirements/requirements-all.txt @@ -9,7 +9,7 @@ tqdm uvicorn python-dotenv pepdbagent>=0.6.0 -peppy<=0.40.0a4 +peppy>=0.40.0a4 qdrant-client requests aiofiles