-
Notifications
You must be signed in to change notification settings - Fork 69
Fix API doc build #556
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
Fix API doc build #556
Changes from all commits
d2a59d5
6e36cfd
37c83dd
9d7e2b4
20070e2
f25f182
db2d6ad
1f40512
e5321a4
8772d69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # Features | ||
|
|
||
| ```{toctree} | ||
| :maxdepth: | ||
| :maxdepth: 2 | ||
|
|
||
| extension.rst | ||
| collab.rst | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,8 +43,7 @@ class GISDocument(CommWidget): | |
| """ | ||
| Create a new GISDocument object. | ||
|
|
||
| :param path: the path to the file that you would like to open. | ||
| If not provided, a new empty document will be created. | ||
| :param path: the path to the file that you would like to open. If not provided, a new empty document will be created. | ||
| """ | ||
|
|
||
| def __init__( | ||
|
|
@@ -234,7 +233,7 @@ def add_geojson_layer( | |
| logical_op: str | None = None, | ||
| feature: str | None = None, | ||
| operator: str | None = None, | ||
| value: Union[str, number, float] | None = None, | ||
| value: Union[str, int, float] | None = None, | ||
| color_expr=None, | ||
| ): | ||
| """ | ||
|
|
@@ -244,7 +243,6 @@ def add_geojson_layer( | |
| :param path: The path to the JSON file to embed into the jGIS file. | ||
| :param data: The raw GeoJSON data to embed into the jGIS file. | ||
| :param type: The type of the vector layer to create. | ||
| :param color: The color to apply to features. | ||
| :param opacity: The opacity, between 0 and 1. | ||
| :param color_expr: The style expression used to style the layer, defaults to None | ||
| """ | ||
|
|
@@ -334,9 +332,9 @@ def add_image_layer( | |
|
|
||
| def add_video_layer( | ||
| self, | ||
| urls: [], | ||
| urls: List, | ||
| name: str = "Image Layer", | ||
| coordinates: [] = [], | ||
| coordinates: Optional[List] = None, | ||
| opacity: float = 1, | ||
| ): | ||
| """ | ||
|
|
@@ -347,6 +345,8 @@ def add_video_layer( | |
| :param coordinates: Corners of video specified in longitude, latitude pairs. | ||
| :param opacity: The opacity, between 0 and 1. | ||
| """ | ||
| if coordinates is None: | ||
| coordinates = [] | ||
|
|
||
| if urls is None or coordinates is None: | ||
| raise ValueError("URLs and Coordinates are required") | ||
|
|
@@ -383,14 +383,14 @@ def add_tiff_layer( | |
| """ | ||
| Add a tiff layer | ||
|
|
||
| :param str url: URL of the tif | ||
| :param int min: Minimum pixel value to be displayed, defaults to letting the map display set the value | ||
| :param int max: Maximum pixel value to be displayed, defaults to letting the map display set the value | ||
| :param str name: The name that will be used for the object in the document, defaults to "Tiff Layer" | ||
| :param bool normalize: Select whether to normalize values between 0..1, if false than min/max have no effect, defaults to True | ||
| :param bool wrapX: Render tiles beyond the tile grid extent, defaults to False | ||
| :param float opacity: The opacity, between 0 and 1, defaults to 1.0 | ||
| :param _type_ color_expr: The style expression used to style the layer, defaults to None | ||
| :param url: URL of the tif | ||
| :param min: Minimum pixel value to be displayed, defaults to letting the map display set the value | ||
| :param max: Maximum pixel value to be displayed, defaults to letting the map display set the value | ||
| :param name: The name that will be used for the object in the document, defaults to "Tiff Layer" | ||
| :param normalize: Select whether to normalize values between 0..1, if false than min/max have no effect, defaults to True | ||
| :param wrapX: Render tiles beyond the tile grid extent, defaults to False | ||
| :param opacity: The opacity, between 0 and 1, defaults to 1.0 | ||
| :param color_expr: The style expression used to style the layer, defaults to None | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repeating the types in the docstring is not necessary, the documentation generator will find the annotations in the function signature! |
||
| """ | ||
|
|
||
| source = { | ||
|
|
@@ -421,7 +421,7 @@ def add_hillshade_layer( | |
| self, | ||
| url: str, | ||
| name: str = "Hillshade Layer", | ||
| urlParameters: Dict = {}, | ||
| urlParameters: Optional[Dict] = None, | ||
| attribution: str = "", | ||
| ): | ||
| """ | ||
|
|
@@ -431,6 +431,8 @@ def add_hillshade_layer( | |
| :param str name: The name that will be used for the object in the document, defaults to "Hillshade Layer" | ||
| :param attribution: The attribution. | ||
| """ | ||
| if urlParameters is None: | ||
| urlParameters = {} | ||
|
|
||
| source = { | ||
| "type": SourceType.RasterDemSource, | ||
|
|
@@ -454,14 +456,14 @@ def add_hillshade_layer( | |
|
|
||
| def add_heatmap_layer( | ||
| self, | ||
| feature: string, | ||
| feature: str, | ||
| path: str | Path | None = None, | ||
| data: Dict | None = None, | ||
| name: str = "Heatmap Layer", | ||
| opacity: float = 1, | ||
| blur: number = 15, | ||
| radius: number = 8, | ||
| gradient: List[str] = ["#00f", "#0ff", "#0f0", "#ff0", "#f00"], | ||
| blur: int = 15, | ||
| radius: int = 8, | ||
| gradient: Optional[List[str]] = None, | ||
| ): | ||
| """ | ||
| Add a Heatmap Layer to the document. | ||
|
|
@@ -495,6 +497,9 @@ def add_heatmap_layer( | |
| if data is not None: | ||
| parameters = {"data": data} | ||
|
|
||
| if gradient is None: | ||
| gradient = ["#00f", "#0ff", "#0f0", "#ff0", "#f00"] | ||
|
|
||
| source = { | ||
| "type": SourceType.GeoJSONSource, | ||
| "name": f"{name} Source", | ||
|
|
@@ -609,16 +614,16 @@ def add_filter( | |
| logical_op: str, | ||
| feature: str, | ||
| operator: str, | ||
| value: Union[str, number, float], | ||
| value: Union[str, int, float], | ||
| ): | ||
| """ | ||
| Add a filter to a layer | ||
|
|
||
| :param str layer_id: The ID of the layer to filter | ||
| :param str logical_op: The logical combination to apply to filters. Must be "any" or "all" | ||
| :param str feature: The feature to be filtered on | ||
| :param str operator: The operator used to compare the feature and value | ||
| :param Union[str, number, float] value: The value to be filtered on | ||
| :param layer_id: The ID of the layer to filter | ||
| :param logical_op: The logical combination to apply to filters. Must be "any" or "all" | ||
| :param feature: The feature to be filtered on | ||
| :param operator: The operator used to compare the feature and value | ||
| :param value: The value to be filtered on | ||
| """ | ||
| layer = self._layers.get(layer_id) | ||
|
|
||
|
|
@@ -655,16 +660,16 @@ def update_filter( | |
| logical_op: str, | ||
| feature: str, | ||
| operator: str, | ||
| value: Union[str, number, float], | ||
| value: Union[str, int, float], | ||
| ): | ||
| """ | ||
| Update a filter applied to a layer | ||
|
|
||
| :param str layer_id: The ID of the layer to filter | ||
| :param str logical_op: The logical combination to apply to filters. Must be "any" or "all" | ||
| :param str feature: The feature to update the value for | ||
| :param str operator: The operator used to compare the feature and value | ||
| :param Union[str, number, float] value: The new value to be filtered on | ||
| :param layer_id: The ID of the layer to filter | ||
| :param logical_op: The logical combination to apply to filters. Must be "any" or "all" | ||
| :param feature: The feature to update the value for | ||
| :param operator: The operator used to compare the feature and value | ||
| :param value: The new value to be filtered on | ||
| """ | ||
| layer = self._layers.get(layer_id) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| """Build all JupyterGIS packages. | ||
|
|
||
| IMPORTANT: Requires dependencies in requirements-build.txt | ||
| """ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I felt we should decouple dependency install from building. |
||
|
|
||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
|
|
@@ -8,8 +13,6 @@ def execute(cmd: str, cwd=None): | |
|
|
||
| def build_packages(): | ||
| root_path = Path(__file__).parents[1] | ||
| requirements_build_path = root_path / "requirements-build.txt" | ||
| install_build_deps = f"python -m pip install -r {requirements_build_path}" | ||
|
|
||
| python_package_prefix = "python" | ||
| python_packages = [ | ||
|
|
@@ -20,8 +23,6 @@ def build_packages(): | |
| "jupytergis_lite", | ||
| ] | ||
|
|
||
| execute(install_build_deps) | ||
|
|
||
| for py_package in python_packages: | ||
| execute("hatch build", cwd=root_path / python_package_prefix / py_package) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching between typescript and python is a big oof on my brain 🤕