Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

environment, stylesheet, etc. #26

Merged
merged 5 commits into from
Mar 16, 2023
Merged

environment, stylesheet, etc. #26

merged 5 commits into from
Mar 16, 2023

Conversation

Beauprel
Copy link
Contributor

modified environment.yml, added stylesheet, added func to show list of categorical colors, improved checks in timeseries()

@@ -150,10 +150,12 @@ def set_plot_attrs(attr_dict, xr_obj, ax):

if 'ylabel' in attr_dict:
if 'yunits' in attr_dict and len(get_attributes(attr_dict['yunits'], xr_obj)) >= 1: # second condition avoids '[]' as label
ax.set_ylabel(get_attributes(attr_dict['ylabel'], xr_obj) + ' (' +
get_attributes(attr_dict['yunits'], xr_obj) + ')')
ylabel = wrap_text(get_attributes(attr_dict['ylabel'], xr_obj) + ' (' +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap_text pourrait être ajouter à xlabel et title.
Les longueurs de strings pourraient être modifier en fonction de s'il s'agit du titre (timeseries vs gridmap), label, colorbar.
Sinon pour les titres il serait aussi possible d'utiliser textwrap (https://docs.python.org/3/library/textwrap.html)

""" Return a list of the categorical colors associated with certain strings (SSP,RCP,CMIP)."""
path = Path(__file__).parents[1] / 'data/ipcc_colors/categorical_colors.json'
with open(path) as f:
cat = json.load(f)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce que les couleurs associées aux modèles (CanESM5, MPI,...) sont dans le json?

ytick.color : k

### FIGURE
figure.figsize : 8, 6 # default
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourrait être dans une autre stylesheet pour avoir une version notebook, article ou présentation.

@Beauprel Beauprel merged commit 40960a3 into main Mar 16, 2023
@Beauprel Beauprel deleted the environment branch March 16, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants