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

Lazy load modules #709

Merged
merged 7 commits into from
Apr 4, 2024
Merged

Lazy load modules #709

merged 7 commits into from
Apr 4, 2024

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Feb 19, 2024

Main:
image

This branch:
image

Ran with: python -X importtime -c "import geoviews" 2> log.txt && tuna log.txt

@philippjfr
Copy link
Member

Nice!

Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

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

Importing annotate dynamically means that the following top-level statements will no longer be executed when GeoViews is simply imported. It seems to me that it's fine since annotate is usually imported by users when they want to annotate geo data.

Annotator._tools = [CheckpointTool, RestoreTool, ClearTool]
Annotator.table_transforms.append(project.instance(projection=ccrs.PlateCarree()))
PointAnnotator._link_type = get_point_table_link
RectangleAnnotator._link_type = get_rectangles_table_link
PathAnnotator._vertex_table_link = get_vertex_table_link
PolyAnnotator._vertex_table_link = get_vertex_table_link
Annotator._extra_opts['hooks'] = [initialize_tools]
annotate._annotator_types[Path] = PathBreakingAnnotator

@hoxbro hoxbro merged commit 6a3dadc into main Apr 4, 2024
9 checks passed
@hoxbro hoxbro deleted the lazy_load branch April 4, 2024 14:46
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.

3 participants