Skip to content

Commit

Permalink
Change linecolors. (#7)
Browse files Browse the repository at this point in the history
* Change linecolors to sequence previously used with IDL.

* Bump patch level.

* Adapt formatting to match requirements of 'black'.

* Remove re-use of colors and issue error message instead.
  • Loading branch information
pirmink authored Jul 12, 2024
1 parent c510c0f commit a72c948
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "moveroplot"
version = "1.1.3"
version = "1.1.4"
description = "Movero-plot"
readme = "README.md"
keywords = [
Expand Down
18 changes: 10 additions & 8 deletions src/moveroplot/config/plot_settings.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"""Static configurations settings for plots."""

modelcolors: list[str] = [
"black",
"red",
"blue",
"green",
"cyan",
"yellow",
"magenta",
"orange",
"tab:red",
"tab:blue",
"tab:orange",
"tab:green",
"tab:purple",
"tab:brown",
"tab:pink",
"tab:gray",
"tab:olive",
"tab:cyan",
]

line_styles: list[str] = ["-", ":", "--", "-."]
Expand Down
10 changes: 10 additions & 0 deletions src/moveroplot/parse_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ def _parse_inputs(
"""
)
plot_settings.modelcolors = color_list
else:
if len(all_model_versions) > len(plot_settings.modelcolors):
raise ValueError(
f"""
The number of model versions is larger than the
number of predefined colors for plotting
({len(all_model_versions)} > {len(plot_settings.modelcolors)})
"""
)

plot_models_setup = [
model_combinations.split("/")
for model_combinations in model_versions.split(",")
Expand Down

0 comments on commit a72c948

Please sign in to comment.