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

feat: plot_numeric_data for plotly_wrapper #395

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mschrader15
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b9894e9) 88.15% compared to head (7d876f9) 87.74%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #395      +/-   ##
==========================================
- Coverage   88.15%   87.74%   -0.41%     
==========================================
  Files          66       66              
  Lines        2929     2929              
==========================================
- Hits         2582     2570      -12     
- Misses        347      359      +12     
Flag Coverage Δ
macos-latest-python3.11 87.16% <ø> (-0.48%) ⬇️
ubuntu-latest-python3.10 87.06% <ø> (-0.41%) ⬇️
ubuntu-latest-python3.11 87.12% <ø> (-0.41%) ⬇️
ubuntu-latest-python3.8 87.04% <ø> (-0.48%) ⬇️
ubuntu-latest-python3.9 87.04% <ø> (-0.42%) ⬇️
windows-latest-python3.11 87.23% <ø> (-0.41%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@piotrgramacki piotrgramacki left a comment

Choose a reason for hiding this comment

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

Thanks for the implementation of this missing plotting function. I've found a minor issue when running it, but it should be relatively straightforward to fix ;)

regions_gdf: gpd.GeoDataFrame,
data_column: str,
data_df: Optional[Union[gpd.GeoDataFrame, pd.DataFrame]] = None,
colormap: Union[str, List[str]] = px.colors.sequential.Sunsetdark,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This colormap, which is the default, throws an error. I suppose that this is because this one is in RGB format so it is not a List[str] but List[Tuple]

ValueError: 
    Invalid value of type 'builtins.list' received for the 'colorscale' property of make_figure

width (float, optional): Width of the plot. Defaults to None.
"""
regions_gdf_copy = regions_gdf.copy()
regions_gdf_copy[REGIONS_INDEX] = regions_gdf_copy.index
Copy link
Collaborator

Choose a reason for hiding this comment

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

When I pass a geodataframe with regions from our regionalizer I get an error, because we set index name to REGIONS_INDEX. It results in an error on merge, because there is a column and index with the same name in regions_gdf_copy

ValueError: 'region_id' is both an index level and a column label, which is ambiguous.

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