apmtools 0.2.10__tar.gz → 0.2.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: apmtools
3
- Version: 0.2.010
3
+ Version: 0.2.011
4
4
  Summary: A collection of tools for processing air pollution monitoring data
5
5
  Project-URL: Homepage, https://github.com/federlorenz/apmtools
6
6
  Author-email: Federico Lorenzetti <lorenzetti.federico@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "apmtools"
7
- version = "0.2.010"
7
+ version = "0.2.011"
8
8
  authors = [
9
9
  { name="Federico Lorenzetti", email="lorenzetti.federico@gmail.com" },
10
10
  ]
@@ -570,15 +570,19 @@ def create_summary_app(
570
570
  if group_columns:
571
571
  group_column = "__plot_group"
572
572
  line_columns = [x_column, group_column, *y_columns]
573
- if identifier_column is not None:
574
- line_columns.append(identifier_column)
573
+ line_group_column = identifier_column or section_column
574
+ if line_group_column is not None:
575
+ line_columns.append(line_group_column)
576
+
577
+ # Keep whichever column controls line segmentation as an
578
+ # id_var during melt(). Otherwise pandas drops it and
579
+ # Plotly cannot resolve line_group (e.g. __line_section).
580
+ id_vars = [x_column, group_column]
581
+ if line_group_column is not None:
582
+ id_vars.append(line_group_column)
583
+
575
584
  long_df = plot_df[line_columns].melt(
576
- id_vars=[
577
- x_column,
578
- group_column,
579
- *([identifier_column]
580
- if identifier_column is not None else []),
581
- ],
585
+ id_vars=id_vars,
582
586
  var_name="variable",
583
587
  value_name="value",
584
588
  )
@@ -587,7 +591,7 @@ def create_summary_app(
587
591
  x=x_column,
588
592
  y="value",
589
593
  color=group_column,
590
- line_group=identifier_column or section_column,
594
+ line_group=line_group_column,
591
595
  facet_row="variable" if len(y_columns) > 1 else None,
592
596
  )
593
597
  elif identifier_column is not None:
File without changes
File without changes
File without changes