From b1b451daceaad2b0c3800d4e79ef76e8f98c6def Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:41:05 -0400 Subject: [PATCH 1/7] make samples type array and nest under items #204 --- pipestat/parsed_schema.py | 6 + tests/data/output_schema.yaml | 12 +- tests/data/output_schema_as_JSON_schema.yaml | 90 +++++++------- tests/data/output_schema_html_report.yaml | 42 +++---- tests/data/sample_output_schema.yaml | 50 ++++---- ...with_project_with_samples_with_status.yaml | 30 ++--- ...h_project_with_samples_without_status.yaml | 30 ++--- ...hout_project_with_samples_with_status.yaml | 30 ++--- ...t_project_with_samples_without_status.yaml | 30 ++--- .../data/sample_output_schema_highlight.yaml | 88 +++++++------- .../data/sample_output_schema_recursive.yaml | 106 ++++++++--------- tests/data/sample_output_schema_sqlite.yaml | 18 +-- .../data/sample_output_schema_with_index.yaml | 110 +++++++++--------- 13 files changed, 336 insertions(+), 306 deletions(-) diff --git a/pipestat/parsed_schema.py b/pipestat/parsed_schema.py index ed4ea6c8..f8830efc 100644 --- a/pipestat/parsed_schema.py +++ b/pipestat/parsed_schema.py @@ -95,10 +95,16 @@ def __init__(self, data: Union[Dict[str, Any], Path, str]) -> None: self._pipeline_name = data["properties"].pop(SCHEMA_PIPELINE_NAME_KEY, None) + # Two passes for sample-data as it is now nested under items per #204 sample_data = _safe_pop_one_mapping( subkeys=["samples"], data=data["properties"], info_name="sample-level", + mappingkey="items", + ) + sample_data = _safe_pop_one_mapping( + data=sample_data, + info_name="sample-level", mappingkey="properties", ) diff --git a/tests/data/output_schema.yaml b/tests/data/output_schema.yaml index d4ecbc1e..01f83fff 100644 --- a/tests/data/output_schema.yaml +++ b/tests/data/output_schema.yaml @@ -4,9 +4,11 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - result_name: - type: string - description: "ResultName" + type: array + items: + type: object + properties: + result_name: + type: string + description: "ResultName" diff --git a/tests/data/output_schema_as_JSON_schema.yaml b/tests/data/output_schema_as_JSON_schema.yaml index 64582f20..d8cc84f4 100644 --- a/tests/data/output_schema_as_JSON_schema.yaml +++ b/tests/data/output_schema_as_JSON_schema.yaml @@ -4,54 +4,56 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - number_of_things: - type: integer - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." - output_image: - $ref: "#/$defs/image" - description: "This an output image" - output_file: - $ref: "#/$defs/file" - description: "This a path to the output image" - collection_of_images: - type: array - description: A collection of images. - items: + type: array + items: + type: object + properties: + number_of_things: + type: integer + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + output_image: + $ref: "#/$defs/image" + description: "This an output image" + output_file: + $ref: "#/$defs/file" + description: "This a path to the output image" + collection_of_images: + type: array + description: A collection of images. + items: + type: object + properties: + prop1: + $ref: "#/$defs/file" + description: An example file. + nested_object: type: object + description: An object containing output file and image. properties: - prop1: + example_property_1: $ref: "#/$defs/file" description: An example file. - nested_object: - type: object - description: An object containing output file and image. - properties: - example_property_1: - $ref: "#/$defs/file" - description: An example file. - example_property_2: - $ref: "#/$defs/image" - description: An example image. - output_file_nested_object: - type: object - description: First Level - properties: - example_property_1: - type: object - description: Second Level - properties: - third_level_property_1: - $ref: "#/$defs/file" - description: Third Level - example_property_2: - type: object - description: Second Level - properties: - third_level_property_1: - $ref: "#/$defs/file" - description: Third Level + example_property_2: + $ref: "#/$defs/image" + description: An example image. + output_file_nested_object: + type: object + description: First Level + properties: + example_property_1: + type: object + description: Second Level + properties: + third_level_property_1: + $ref: "#/$defs/file" + description: Third Level + example_property_2: + type: object + description: Second Level + properties: + third_level_property_1: + $ref: "#/$defs/file" + description: Third Level $defs: image: type: object diff --git a/tests/data/output_schema_html_report.yaml b/tests/data/output_schema_html_report.yaml index 46a88e7d..f1dd0eda 100644 --- a/tests/data/output_schema_html_report.yaml +++ b/tests/data/output_schema_html_report.yaml @@ -19,26 +19,28 @@ properties: type: boolean description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra." samples: - type: object - properties: - smooth_bw: - path: "aligned_{genome}/{sample_name}_smooth.bw" - type: string - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla." - aligned_bam: - path: "aligned_{genome}/{sample_name}_sort.bam" - type: string - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ipsum erat, porta in condimentum viverra, pellentesque in nisl. Nulla rhoncus nibh est, quis malesuada diam suscipit at. In ut diam." - peaks_bed: - path: "peak_calling_{genome}/{sample_name}_peaks.bed" - type: string - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla." - output_file: - $ref: "#/$defs/file" - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla." - output_image: - $ref: "#/$defs/image" - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra." + type: array + items: + type: object + properties: + smooth_bw: + path: "aligned_{genome}/{sample_name}_smooth.bw" + type: string + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla." + aligned_bam: + path: "aligned_{genome}/{sample_name}_sort.bam" + type: string + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ipsum erat, porta in condimentum viverra, pellentesque in nisl. Nulla rhoncus nibh est, quis malesuada diam suscipit at. In ut diam." + peaks_bed: + path: "peak_calling_{genome}/{sample_name}_peaks.bed" + type: string + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla." + output_file: + $ref: "#/$defs/file" + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla." + output_image: + $ref: "#/$defs/image" + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra." $defs: image: type: object diff --git a/tests/data/sample_output_schema.yaml b/tests/data/sample_output_schema.yaml index 3211ccdd..eb7bbd2d 100644 --- a/tests/data/sample_output_schema.yaml +++ b/tests/data/sample_output_schema.yaml @@ -4,30 +4,32 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - number_of_things: - type: integer - description: "Number of things" - percentage_of_things: - type: number - description: "Percentage of things" - name_of_something: - type: string - description: "Name of something" - switch_value: - type: boolean - description: "Is the switch on or off" - output_file: - $ref: "#/$defs/file" - description: "This a path to the output file" - output_image: - $ref: "#/$defs/image" - description: "This a path to the output image" - md5sum: - type: string - description: "MD5SUM of an object" - highlight: true + type: array + items: + type: object + properties: + number_of_things: + type: integer + description: "Number of things" + percentage_of_things: + type: number + description: "Percentage of things" + name_of_something: + type: string + description: "Name of something" + switch_value: + type: boolean + description: "Is the switch on or off" + output_file: + $ref: "#/$defs/file" + description: "This a path to the output file" + output_image: + $ref: "#/$defs/image" + description: "This a path to the output image" + md5sum: + type: string + description: "MD5SUM of an object" + highlight: true $defs: image: type: object diff --git a/tests/data/sample_output_schema__with_project_with_samples_with_status.yaml b/tests/data/sample_output_schema__with_project_with_samples_with_status.yaml index e5d48a1c..e70d63ec 100644 --- a/tests/data/sample_output_schema__with_project_with_samples_with_status.yaml +++ b/tests/data/sample_output_schema__with_project_with_samples_with_status.yaml @@ -19,20 +19,22 @@ properties: type: boolean description: "Is the switch on or off" samples: - type: object - properties: - smooth_bw: - path: "aligned_{genome}/{sample_name}_smooth.bw" - type: string - description: "A smooth bigwig file" - aligned_bam: - path: "aligned_{genome}/{sample_name}_sort.bam" - type: string - description: "A sorted, aligned BAM file" - peaks_bed: - path: "peak_calling_{genome}/{sample_name}_peaks.bed" - type: string - description: "Peaks in BED format" + type: array + items: + type: object + properties: + smooth_bw: + path: "aligned_{genome}/{sample_name}_smooth.bw" + type: string + description: "A smooth bigwig file" + aligned_bam: + path: "aligned_{genome}/{sample_name}_sort.bam" + type: string + description: "A sorted, aligned BAM file" + peaks_bed: + path: "peak_calling_{genome}/{sample_name}_peaks.bed" + type: string + description: "Peaks in BED format" status: type: object properties: diff --git a/tests/data/sample_output_schema__with_project_with_samples_without_status.yaml b/tests/data/sample_output_schema__with_project_with_samples_without_status.yaml index 649abdaa..4a44d4ce 100644 --- a/tests/data/sample_output_schema__with_project_with_samples_without_status.yaml +++ b/tests/data/sample_output_schema__with_project_with_samples_without_status.yaml @@ -19,17 +19,19 @@ properties: type: boolean description: "Is the switch on or off" samples: - type: object - properties: - smooth_bw: - path: "aligned_{genome}/{sample_name}_smooth.bw" - type: string - description: "A smooth bigwig file" - aligned_bam: - path: "aligned_{genome}/{sample_name}_sort.bam" - type: string - description: "A sorted, aligned BAM file" - peaks_bed: - path: "peak_calling_{genome}/{sample_name}_peaks.bed" - type: string - description: "Peaks in BED format" + type: array + items: + type: object + properties: + smooth_bw: + path: "aligned_{genome}/{sample_name}_smooth.bw" + type: string + description: "A smooth bigwig file" + aligned_bam: + path: "aligned_{genome}/{sample_name}_sort.bam" + type: string + description: "A sorted, aligned BAM file" + peaks_bed: + path: "peak_calling_{genome}/{sample_name}_peaks.bed" + type: string + description: "Peaks in BED format" diff --git a/tests/data/sample_output_schema__without_project_with_samples_with_status.yaml b/tests/data/sample_output_schema__without_project_with_samples_with_status.yaml index 577f7ec6..bf76a542 100644 --- a/tests/data/sample_output_schema__without_project_with_samples_with_status.yaml +++ b/tests/data/sample_output_schema__without_project_with_samples_with_status.yaml @@ -4,20 +4,22 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - smooth_bw: - path: "aligned_{genome}/{sample_name}_smooth.bw" - type: string - description: "A smooth bigwig file" - aligned_bam: - path: "aligned_{genome}/{sample_name}_sort.bam" - type: string - description: "A sorted, aligned BAM file" - peaks_bed: - path: "peak_calling_{genome}/{sample_name}_peaks.bed" - type: string - description: "Peaks in BED format" + type: array + items: + type: object + properties: + smooth_bw: + path: "aligned_{genome}/{sample_name}_smooth.bw" + type: string + description: "A smooth bigwig file" + aligned_bam: + path: "aligned_{genome}/{sample_name}_sort.bam" + type: string + description: "A sorted, aligned BAM file" + peaks_bed: + path: "peak_calling_{genome}/{sample_name}_peaks.bed" + type: string + description: "Peaks in BED format" status: type: object properties: diff --git a/tests/data/sample_output_schema__without_project_with_samples_without_status.yaml b/tests/data/sample_output_schema__without_project_with_samples_without_status.yaml index 501f1bb1..f329ebcc 100644 --- a/tests/data/sample_output_schema__without_project_with_samples_without_status.yaml +++ b/tests/data/sample_output_schema__without_project_with_samples_without_status.yaml @@ -4,17 +4,19 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - smooth_bw: - path: "aligned_{genome}/{sample_name}_smooth.bw" - type: string - description: "A smooth bigwig file" - aligned_bam: - path: "aligned_{genome}/{sample_name}_sort.bam" - type: string - description: "A sorted, aligned BAM file" - peaks_bed: - path: "peak_calling_{genome}/{sample_name}_peaks.bed" - type: string - description: "Peaks in BED format" + type: array + items: + type: object + properties: + smooth_bw: + path: "aligned_{genome}/{sample_name}_smooth.bw" + type: string + description: "A smooth bigwig file" + aligned_bam: + path: "aligned_{genome}/{sample_name}_sort.bam" + type: string + description: "A sorted, aligned BAM file" + peaks_bed: + path: "peak_calling_{genome}/{sample_name}_peaks.bed" + type: string + description: "Peaks in BED format" diff --git a/tests/data/sample_output_schema_highlight.yaml b/tests/data/sample_output_schema_highlight.yaml index 7d5dbc16..06acfa37 100644 --- a/tests/data/sample_output_schema_highlight.yaml +++ b/tests/data/sample_output_schema_highlight.yaml @@ -4,49 +4,51 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - number_of_things: - type: integer - description: "Number of things" - percentage_of_things: - type: number - description: "Percentage of things" - name_of_something: - type: string - description: "Name of something" - switch_value: - type: boolean - description: "Is the switch on or off" - collection_of_things: - type: array - description: "This store collection of values" - output_object: - type: object - description: "Object output" - output_file: - $ref: "#/$defs/file" - description: "This a path to the output file" - output_image: - $ref: "#/$defs/image" - highlight: false - description: "This a path to the output image" - log: - $ref: "#/$defs/file" - highlight: true - description: "The log file of the pipeline run" - profile: - $ref: "#/$defs/file" - highlight: true - description: "The profile of the pipeline run" - commands: - $ref: "#/$defs/file" - highlight: true - description: "The file with shell commands executed by this pipeline" - version: - type: string - highlight: true - description: "Pipeline version" + type: array + items: + type: object + properties: + number_of_things: + type: integer + description: "Number of things" + percentage_of_things: + type: number + description: "Percentage of things" + name_of_something: + type: string + description: "Name of something" + switch_value: + type: boolean + description: "Is the switch on or off" + collection_of_things: + type: array + description: "This store collection of values" + output_object: + type: object + description: "Object output" + output_file: + $ref: "#/$defs/file" + description: "This a path to the output file" + output_image: + $ref: "#/$defs/image" + highlight: false + description: "This a path to the output image" + log: + $ref: "#/$defs/file" + highlight: true + description: "The log file of the pipeline run" + profile: + $ref: "#/$defs/file" + highlight: true + description: "The profile of the pipeline run" + commands: + $ref: "#/$defs/file" + highlight: true + description: "The file with shell commands executed by this pipeline" + version: + type: string + highlight: true + description: "Pipeline version" $defs: image: type: object diff --git a/tests/data/sample_output_schema_recursive.yaml b/tests/data/sample_output_schema_recursive.yaml index 1e315a88..ee916039 100644 --- a/tests/data/sample_output_schema_recursive.yaml +++ b/tests/data/sample_output_schema_recursive.yaml @@ -4,59 +4,61 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - number_of_things: - type: integer - description: "Number of things" - percentage_of_things: - type: number - description: "Percentage of things" - name_of_something: - type: string - description: "Name of something" - switch_value: - type: boolean - description: "Is the switch on or off" - md5sum: - type: string - description: "MD5SUM of an object" - highlight: true - collection_of_images: - description: "This store collection of values or objects" - type: array - items: - properties: - prop1: - description: "This is an example file" - $ref: "#/$defs/file" - output_file_in_object: - type: object - properties: - prop1: - description: "This is an example file" - $ref: "#/$defs/file" - prop2: - description: "This is an example image" - $ref: "#/$defs/image" - description: "Object output" - output_file_in_object_nested: - type: object - description: First Level - properties: - prop1: - type: object - description: Second Level + type: array + items: + type: object + properties: + number_of_things: + type: integer + description: "Number of things" + percentage_of_things: + type: number + description: "Percentage of things" + name_of_something: + type: string + description: "Name of something" + switch_value: + type: boolean + description: "Is the switch on or off" + md5sum: + type: string + description: "MD5SUM of an object" + highlight: true + collection_of_images: + description: "This store collection of values or objects" + type: array + items: properties: - prop2: - type: integer - description: Third Level - output_file: - $ref: "#/$defs/file" - description: "This a path to the output file" - output_image: - $ref: "#/$defs/image" - description: "This a path to the output image" + prop1: + description: "This is an example file" + $ref: "#/$defs/file" + output_file_in_object: + type: object + properties: + prop1: + description: "This is an example file" + $ref: "#/$defs/file" + prop2: + description: "This is an example image" + $ref: "#/$defs/image" + description: "Object output" + output_file_in_object_nested: + type: object + description: First Level + properties: + prop1: + type: object + description: Second Level + properties: + prop2: + type: integer + description: Third Level + output_file: + $ref: "#/$defs/file" + description: "This a path to the output file" + output_image: + $ref: "#/$defs/image" + description: "This a path to the output image" $defs: image: type: object diff --git a/tests/data/sample_output_schema_sqlite.yaml b/tests/data/sample_output_schema_sqlite.yaml index d3687b72..5cd14543 100644 --- a/tests/data/sample_output_schema_sqlite.yaml +++ b/tests/data/sample_output_schema_sqlite.yaml @@ -4,11 +4,13 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - number_of_things: - type: integer - description: "Number of things" - percentage_of_things: - type: number - description: "Percentage of things" \ No newline at end of file + type: array + items: + type: object + properties: + number_of_things: + type: integer + description: "Number of things" + percentage_of_things: + type: number + description: "Percentage of things" \ No newline at end of file diff --git a/tests/data/sample_output_schema_with_index.yaml b/tests/data/sample_output_schema_with_index.yaml index 6e48de7e..6b25a494 100644 --- a/tests/data/sample_output_schema_with_index.yaml +++ b/tests/data/sample_output_schema_with_index.yaml @@ -4,61 +4,63 @@ type: object properties: pipeline_name: "default_pipeline_name" samples: - type: object - properties: - number_of_things: - type: integer - description: "Number of things" - percentage_of_things: - type: number - description: "Percentage of things" - name_of_something: - type: string - description: "Name of something" - switch_value: - type: boolean - description: "Is the switch on or off" - md5sum: - type: string - description: "MD5SUM of an object" - highlight: true - index: True - collection_of_images: - description: "This store collection of values or objects" - type: array - items: - properties: - prop1: - description: "This is an example file" - $ref: "#/$defs/file" - output_file_in_object: - type: object - index: True - properties: - prop1: - description: "This is an example file" - $ref: "#/$defs/file" - prop2: - description: "This is an example image" - $ref: "#/$defs/image" - description: "Object output" - output_file_in_object_nested: - type: object - description: First Level - properties: - prop1: - type: object - description: Second Level + type: array + items: + type: object + properties: + number_of_things: + type: integer + description: "Number of things" + percentage_of_things: + type: number + description: "Percentage of things" + name_of_something: + type: string + description: "Name of something" + switch_value: + type: boolean + description: "Is the switch on or off" + md5sum: + type: string + description: "MD5SUM of an object" + highlight: true + index: True + collection_of_images: + description: "This store collection of values or objects" + type: array + items: properties: - prop2: - type: integer - description: Third Level - output_file: - $ref: "#/$defs/file" - description: "This a path to the output file" - output_image: - $ref: "#/$defs/image" - description: "This a path to the output image" + prop1: + description: "This is an example file" + $ref: "#/$defs/file" + output_file_in_object: + type: object + index: True + properties: + prop1: + description: "This is an example file" + $ref: "#/$defs/file" + prop2: + description: "This is an example image" + $ref: "#/$defs/image" + description: "Object output" + output_file_in_object_nested: + type: object + description: First Level + properties: + prop1: + type: object + description: Second Level + properties: + prop2: + type: integer + description: Third Level + output_file: + $ref: "#/$defs/file" + description: "This a path to the output file" + output_image: + $ref: "#/$defs/image" + description: "This a path to the output image" $defs: image: type: object From a2dc8305b9969155e137ff0b788ec00fa89b7384 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:11:51 -0400 Subject: [PATCH 2/7] fix pephub test assertion --- tests/test_pipestat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_pipestat.py b/tests/test_pipestat.py index e2505bda..d4dc7b4b 100644 --- a/tests/test_pipestat.py +++ b/tests/test_pipestat.py @@ -2587,7 +2587,7 @@ def test_pephub_backend_retrieve_one( result = psm.retrieve_one(record_identifier=rec_id) - assert len(result.keys()) == 6 + assert len(result.keys()) == 7 @pytest.mark.parametrize( ["rec_id", "val"], @@ -2608,7 +2608,7 @@ def test_pephub_backend_config_file( result = psm.retrieve_one(record_identifier=rec_id) - assert len(result.keys()) == 6 + assert len(result.keys()) == 7 def test_pephub_backend_retrieve_many( self, From b613b74548cfd826604ed0db04839f34d21834aa Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:14:56 -0400 Subject: [PATCH 3/7] update changelog --- docs/changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 1c6e6815..72be1a27 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,10 @@ 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.11.0] - 2024-XX +### Fixed +- for output schema, make samples an array type and nest under items [#204](https://github.com/pepkit/pipestat/issues/204) + ## [0.10.2] - 2024-08-26 ### Fixed - add obtaining pephub_path from config file, [#202](https://github.com/pepkit/pipestat/issues/202) From 8db0d53b29caa3d3710210f05e9fc99e1ef09bdb Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:18:05 -0400 Subject: [PATCH 4/7] another pass at pephub assertions --- tests/test_pipestat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_pipestat.py b/tests/test_pipestat.py index d4dc7b4b..3db977c6 100644 --- a/tests/test_pipestat.py +++ b/tests/test_pipestat.py @@ -2587,7 +2587,7 @@ def test_pephub_backend_retrieve_one( result = psm.retrieve_one(record_identifier=rec_id) - assert len(result.keys()) == 7 + assert len(result.keys()) == 5 @pytest.mark.parametrize( ["rec_id", "val"], @@ -2608,7 +2608,7 @@ def test_pephub_backend_config_file( result = psm.retrieve_one(record_identifier=rec_id) - assert len(result.keys()) == 7 + assert len(result.keys()) == 5 def test_pephub_backend_retrieve_many( self, From 8745908e135414e0f88143fda61f2a32ad18dc0c Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:37:05 -0400 Subject: [PATCH 5/7] change logic for acquiring default_pipeline_name --- pipestat/pipestat.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pipestat/pipestat.py b/pipestat/pipestat.py index 944a676f..2b24fb0e 100644 --- a/pipestat/pipestat.py +++ b/pipestat/pipestat.py @@ -195,14 +195,15 @@ def __init__( ) # TODO this is a work around for Looper ~ https://github.com/pepkit/looper/issues/492, sharing pipeline names - # In the future, we should get piepline name only from output schema. - self.cfg[PIPELINE_NAME] = ( - pipeline_name - or self.cfg[CONFIG_KEY].get(PIPELINE_NAME) - or self.cfg[SCHEMA_KEY].pipeline_name - if self.cfg[SCHEMA_KEY] is not None - else DEFAULT_PIPELINE_NAME - ) + # In the future, we should get pipeline name only from output schema. + if pipeline_name: + self.cfg[PIPELINE_NAME] = pipeline_name + elif self.cfg[CONFIG_KEY].get(PIPELINE_NAME): + self.cfg[PIPELINE_NAME] = self.cfg[CONFIG_KEY].get(PIPELINE_NAME) + elif self.cfg[SCHEMA_KEY] and self.cfg[SCHEMA_KEY].pipeline_name: + self.cfg[PIPELINE_NAME] = self.cfg[SCHEMA_KEY].pipeline_name + else: + self.cfg[PIPELINE_NAME] = DEFAULT_PIPELINE_NAME self.cfg[PROJECT_NAME] = self.cfg[CONFIG_KEY].priority_get( "project_name", env_var=ENV_VARS["project_name"], override=project_name From 41c5dc0301ef6c55ba28db74c481f7c83728e4b2 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:19:50 -0400 Subject: [PATCH 6/7] fix bug with project level objects in report generation --- pipestat/reports.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pipestat/reports.py b/pipestat/reports.py index 515019ba..0ea55047 100644 --- a/pipestat/reports.py +++ b/pipestat/reports.py @@ -366,10 +366,7 @@ def create_object_htmls(self, navbar, footer): links = [] html_page_path = os.path.join(self.pipeline_reports, f"{file_result}.html".lower()) - if self.prj.cfg["multi_result_files"] is True: - pipeline_types = ["sample", "project"] - else: - pipeline_types = [self.prj.backend.pipeline_type] + pipeline_types = ["sample", "project"] for pipeline_type in pipeline_types: self.prj.backend.pipeline_type = pipeline_type @@ -425,10 +422,7 @@ def create_object_htmls(self, navbar, footer): html_page_path = os.path.join(self.pipeline_reports, f"{image_result}.html".lower()) figures = [] - if self.prj.cfg["multi_result_files"] is True: - pipeline_types = ["sample", "project"] - else: - pipeline_types = [self.prj.backend.pipeline_type] + pipeline_types = ["sample", "project"] for pipeline_type in pipeline_types: self.prj.backend.pipeline_type = pipeline_type From 1e554e90b9913e2103386a6d2a3afcd3e7e9320b Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:12:25 -0400 Subject: [PATCH 7/7] update version and changelog for v0.11.0 release --- docs/changelog.md | 6 +++--- pipestat/_version.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 72be1a27..ee426bf8 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,9 +2,11 @@ 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.11.0] - 2024-XX +## [0.11.0] - 2024-10-02 ### Fixed - for output schema, make samples an array type and nest under items [#204](https://github.com/pepkit/pipestat/issues/204) +- pipeline_name not setting correctly [#207](https://github.com/pepkit/pipestat/issues/207) +- bug with objects populating html report ## [0.10.2] - 2024-08-26 ### Fixed @@ -14,7 +16,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixed - add pipestat summarize and link for pephub backend - ## [0.10.0] - 2024-07-18 ### Fixed - allow for bool or boolean in schema [#189](https://github.com/pepkit/pipestat/issues/189) @@ -24,7 +25,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## Added - pephub backend [#125](https://github.com/pepkit/pipestat/issues/125) - ## [0.9.3] - 2024-06-06 ### Fixed - fixed regression with summarizing or creating a table via aggregate_results.yaml and "{record_identifier}" in the results file path diff --git a/pipestat/_version.py b/pipestat/_version.py index 17c1a626..ae6db5f1 100644 --- a/pipestat/_version.py +++ b/pipestat/_version.py @@ -1 +1 @@ -__version__ = "0.10.2" +__version__ = "0.11.0"