Skip to content

Commit f0dfcd8

Browse files
committed
Remove unnecesary parameters like name and id from all the report components to simplify the config file. Also, description and caption were set as opational params and id is generated internally. All class constructors updated with these changes
1 parent 71c9d62 commit f0dfcd8

File tree

7 files changed

+335
-327
lines changed

7 files changed

+335
-327
lines changed

report_metadata_micw2graph.yaml

Lines changed: 27 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
report:
2-
id: 1213412
3-
name: "MicW2Graph"
42
title: "MicW2Graph"
53
description: >
64
Wastewater treatment (WWT) is the process of removing contaminants from used water before it is discharged back
@@ -13,154 +11,88 @@ report:
1311
and potential ecological functions.
1412
graphical_abstract: "example_data/MicW2Graph/Methods_MicW2Graph.png"
1513
logo: "example_data/mona_logo.png"
16-
report_type: "streamlit"
17-
report_format: ""
14+
report_type: "document"
15+
report_format: "html"
1816
sections:
19-
- id: 21324
20-
name: "Exploratory Data analysis"
21-
title: "Exploratory Data analysis"
22-
description: ""
17+
- title: "Exploratory Data Analysis"
2318
subsections:
24-
- id: 5001
25-
name: "Abundance data"
26-
title: "Abundance data"
27-
description: ""
19+
- title: "Abundance data"
20+
description: "Optional description"
2821
components:
29-
- id: 3423
30-
name: "plotly_plot1"
22+
- title: "Top 5 species by biome (plotly)"
3123
component_type: "plot"
3224
plot_type: "interactive"
3325
file_path: "example_data/MicW2Graph/top_species_plot_biome.json"
3426
int_visualization_tool: "plotly"
35-
title: "Top 5 species by biome (plotly)"
36-
caption: ""
37-
- id: 3350
38-
name: "altair_plot1"
27+
caption: "Optional caption"
28+
- title: "Multiline plot (altair)"
3929
component_type: "plot"
4030
plot_type: "interactive"
4131
file_path: "example_data/altair_multilineplot.json"
4232
int_visualization_tool: "altair"
43-
title: "Multiline plot (altair)"
44-
caption: ""
45-
- id: 3358
46-
name: "df1"
33+
- title: "Abundance data for all studies (csv)"
4734
component_type: "dataframe"
4835
file_path: "example_data/MicW2Graph/abundance_data_allbiomes.csv"
4936
file_format: "csv"
5037
delimiter: ","
51-
title: "Abundance data for all studies (csv)"
52-
caption: ""
53-
- id: 3358
54-
name: "df2"
38+
- title: "Abundance data for all studies (excel)"
5539
component_type: "dataframe"
5640
file_path: "example_data/MicW2Graph/abundance_data_allbiomes.xls"
5741
file_format: "excel"
5842
delimiter: ","
59-
title: "Abundance data for all studies (excel)"
60-
caption: ""
61-
- id: 5002
62-
name: "Sample data"
63-
title: "Sample data"
64-
description: ""
43+
- title: "Sample data"
6544
components:
66-
- id: 3324
67-
name: "png_plot1"
45+
- title: "Number of samples per study (png)"
6846
component_type: "plot"
6947
plot_type: "static"
7048
file_path: "example_data/MicW2Graph/number_samples_per_study.png"
71-
title: "Number of samples per study (png)"
72-
caption: ""
73-
- id: 3323
74-
name: "plotly_plot2"
49+
- title: "Sampling countries for all studies (plotly)"
7550
component_type: "plot"
7651
plot_type: "interactive"
7752
file_path: "example_data/MicW2Graph/pie_plot_countries.json"
7853
int_visualization_tool: "plotly"
79-
title: "Sampling countries for all studies (plotly)"
80-
caption: ""
81-
- id: 24324
82-
name: "df3"
54+
- title: "Sample data for all studies (txt)"
8355
component_type: "dataframe"
8456
file_path: "example_data/MicW2Graph/sample_info_allbiomes.txt"
8557
file_format: "txt"
86-
title: "Sample data for all studies (txt)"
87-
caption: ""
88-
- id: 24324
89-
name: "df4"
58+
- title: "Sample data for all studies (parquet)"
9059
component_type: "dataframe"
9160
file_path: "example_data/MicW2Graph/sample_info_allbiomes.parquet"
9261
file_format: "parquet"
93-
title: "Sample data for all studies (parquet)"
94-
caption: ""
95-
- id: 5003
96-
name: "Extra information"
97-
title: "Extra information"
98-
description: ""
62+
- title: "Extra information"
9963
components:
100-
- id: 3358
101-
name: "md1"
64+
- title: "Markdown example"
10265
component_type: "markdown"
10366
file_path: "example_data/test_md.md"
104-
title: "Markdown example"
105-
caption: "This is a markdown example"
106-
- id: 24324
107-
name: "Microbial Association Networks"
108-
title: "Microbial Association Networks"
109-
description: ""
67+
- title: "Microbial Association Networks"
11068
subsections:
111-
- id: 5003
112-
name: "Network Visualization1"
113-
title: "Network Visualization1"
114-
description: ""
69+
- title: "Network Visualization1"
11570
components:
116-
- id: 2247
117-
name: "network1"
71+
- title: "Network1 (graphml)"
11872
component_type: "plot"
11973
plot_type: "interactive"
12074
int_visualization_tool: "pyvis"
12175
file_path: "example_data/MicW2Graph/man_example.graphml"
122-
title: "Network1 (graphml)"
123-
caption: ""
124-
- id: 5003
125-
name: "Network Visualization2"
126-
title: "Network Visualization2"
127-
description: ""
76+
- title: "Network Visualization2"
12877
components:
129-
- id: 2240
130-
name: "network2"
78+
- title: "Network2 (edge list csv)"
13179
component_type: "plot"
13280
plot_type: "interactive"
13381
int_visualization_tool: "pyvis"
13482
csv_network_format: "edgelist"
13583
file_path: "example_data/MicW2Graph/man_example.csv"
136-
title: "Network2 (edge list csv)"
137-
caption: ""
138-
- id: 5004
139-
name: "Edge list"
140-
title: "Edge list"
141-
description: ""
84+
- title: "Edge list"
14285
components:
143-
- id: 3358
144-
name: "df5"
86+
- title: "Edge list (csv)"
14587
component_type: "dataframe"
14688
file_path: "example_data/MicW2Graph/man_example.csv"
14789
file_format: "csv"
14890
delimiter: ","
149-
title: "Edge list (csv)"
15091
caption: "This is the edge list of the network"
151-
- id: 2436
152-
name: "APICall test"
153-
title: "APICall test"
154-
description: ""
92+
- title: "APICall test"
15593
subsections:
156-
- id: 5031
157-
name: "Simple test"
158-
title: "Simple test"
159-
description: ""
94+
- title: "Simple test"
16095
components:
161-
- id: 2987
162-
name: "APIcall_test"
96+
- title: "APICall test"
16397
component_type: "apicall"
16498
api_url: "https://jsonplaceholder.typicode.com/todos/1"
165-
title: "APICall test"
166-
caption: ""

vuegen/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
if __name__ == '__main__':
55
# Load the YAML configuration file with the report metadata
66
config_path = "report_metadata_micw2graph.yaml"
7-
report_metadata = load_yaml_config(config_path)
7+
report_config = load_yaml_config(config_path)
88

99
# Define logger suffix based on report engine, type and name
10-
report_engine = "streamlit"
11-
report_type = report_metadata['report'].get('report_type')
12-
report_format = report_metadata['report'].get('report_format')
13-
report_name = report_metadata['report'].get('name')
10+
report_engine = "quarto"
11+
report_type = report_config['report'].get('report_type')
12+
report_format = report_config['report'].get('report_format')
13+
report_name = report_config['report'].get('name')
1414
if report_engine == "streamlit":
1515
logger_suffix = f"{report_engine}_report_{report_name}"
1616
else:
@@ -20,5 +20,5 @@
2020
logger = get_logger(f"{logger_suffix}")
2121

2222
# Generate the report
23-
report_generator.get_report(metadata=report_metadata, report_engine=report_engine, logger=logger)
23+
report_generator.get_report(config = report_config, report_engine = report_engine, logger = logger)
2424

0 commit comments

Comments
 (0)