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

Restructure0.1 #1

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
78ae268
Add pre-commit-config and ruff linter/formatter
godspeedhuang Aug 18, 2024
eaaaf70
Write use case
godspeedhuang Aug 19, 2024
c22cd33
Add: from raster
godspeedhuang Aug 21, 2024
89e90e6
Update: First Version Check
godspeedhuang Aug 23, 2024
ce73828
Update: First version documentation done
godspeedhuang Aug 23, 2024
df78cae
Update: Restructure Done
godspeedhuang Aug 23, 2024
a82faf4
Update: version tag to 0.3.1
godspeedhuang Aug 23, 2024
82ab191
Move conf.py file
godspeedhuang Aug 23, 2024
c5dd83c
Move conf.py file and add requirements.txt
godspeedhuang Aug 23, 2024
783208f
Update: sphinx_rtd_theme version to 3.0.0rc1
godspeedhuang Aug 23, 2024
df99731
Update: add new feature for set rowkeys directly by fetch_from_hbase
godspeedhuang Aug 23, 2024
5dab28c
Update: add custom name for process_from_raster function
godspeedhuang Aug 24, 2024
f42d55a
Fix: fetch data from hbase bug
godspeedhuang Aug 24, 2024
7bdf293
Fix: self.result can't be None
godspeedhuang Aug 26, 2024
8ba1114
Fix: the potential string return
godspeedhuang Aug 26, 2024
9e29dfc
Fix: remove the geo parameter from process_from_raster
godspeedhuang Aug 27, 2024
2ce4888
Fix: problems of not reading docstring
godspeedhuang Aug 29, 2024
461410b
Fix: problems of not reading docstring 2
godspeedhuang Aug 29, 2024
a1ff379
Fix: problems of not reading docstring 3
godspeedhuang Aug 29, 2024
f91939d
Fix: problems of not reading docstring 4
godspeedhuang Aug 29, 2024
0fb45c3
Add: picture of aggregation functions
godspeedhuang Aug 30, 2024
83f657d
Add: apply function for modifing self.result
godspeedhuang Sep 3, 2024
56314f1
Update hbase with token
godspeedhuang Sep 9, 2024
f52cfbb
Update 03_hbase_data.ipynb
godspeedhuang Sep 9, 2024
2b34d98
Add logger for better track progress inside H3Toolkit object
godspeedhuang Sep 25, 2024
860f989
Add elaborate logger description
godspeedhuang Sep 25, 2024
80d6510
Update: aiohttp version to 3.10.2
godspeedhuang Sep 25, 2024
cfa8337
Update: don't send the empty rowkeys
godspeedhuang Sep 25, 2024
1370834
Downgrade python version to 3.10.12
godspeedhuang Sep 29, 2024
a5c9938
Update: 03_hbase_data
godspeedhuang Oct 8, 2024
0ccde12
Fix docs problem
godspeedhuang Oct 8, 2024
1bc0aeb
Fix docs problem
godspeedhuang Oct 8, 2024
c722abe
Fix docs problem
godspeedhuang Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __pycache__/
*$py.class

# Sphinx documentation
docs/_build/
docs/build/

# Distribution / packaging
dist/
Expand All @@ -31,4 +31,7 @@ test.py
constant.py
data_for_display.py
/testing_file
.DS_Store
.DS_Store

/.ruff_cache
/.pytest_cache
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
args: [ --fix ] # 啟用ruff --fix自動修復,會有類似format的效果
- id: ruff-format
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.12
8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build:

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
Expand All @@ -30,6 +30,6 @@ sphinx:
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
python:
install:
- requirements: docs/requirements.txt
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"jupyter.widgetScriptSources": [
"jsdelivr.com", "unpkg.com"
],
"liveServer.settings.port": 5501
}
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# Add some aggregation function based on h3 index
[![pypi](https://img.shields.io/pypi/v/h3_toolkit.svg)](https://pypi.python.org/pypi/h3_toolkit/)

# h3_toolkit
----------------

python tool for easily aggregating h3 data.

Documentation is available at [https://h3-toolkit.readthedocs.io/en/latest/](https://h3-toolkit.readthedocs.io/en/latest/).
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
28 changes: 0 additions & 28 deletions docs/conf.py

This file was deleted.

60 changes: 60 additions & 0 deletions docs/images/Centroid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions docs/images/Count.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/images/Mean.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SplitEqually.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions docs/images/SplitEqually.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/images/SumUp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 0 additions & 17 deletions docs/index.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand Down
14 changes: 14 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ipykernel
nbsphinx
sphinx_rtd_theme==3.0.0rc1
polars == 1.2.0
geopandas == 1.0.1
h3ronpy == 0.21.0
aiohttp == 3.9.5
pydeck == 0.9.1
matplotlib == 3.9.2
mapclassify == 2.8.0
sqlalchemy == 2.0.32
python-dotenv == 1.0.1
tqdm
shapely
51 changes: 51 additions & 0 deletions docs/source/api/h3_toolkit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
h3\_toolkit package
===================

.. Module contents
.. ---------------

.. .. automodule:: h3_toolkit.core
.. :members:
.. :undoc-members:
.. :show-inheritance:

h3\_toolkit.core module
-----------------------

.. automodule:: h3_toolkit.core
:members:
:undoc-members:
:show-inheritance:

h3\_toolkit.aggregation module
------------------------------

.. automodule:: h3_toolkit.aggregation
:members:
:undoc-members:
:show-inheritance:

h3\_toolkit.hbase module
------------------------

.. automodule:: h3_toolkit.hbase
:members:
:undoc-members:
:show-inheritance:

h3\_toolkit.utils module
------------------------

.. automodule:: h3_toolkit.utils
:members:
:undoc-members:
:show-inheritance:

h3\_toolkit.exceptions module
-----------------------------

.. automodule:: h3_toolkit.exceptions
:members:
:undoc-members:
:show-inheritance:

7 changes: 7 additions & 0 deletions docs/source/api/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API Documentation
=================

.. toctree::
:maxdepth: 4

h3_toolkit
51 changes: 51 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys

sys.path.insert(0, os.path.abspath('../..'))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'h3-toolkit'
copyright = '2024, Ian Huang'
author = 'Ian Huang'
release = '0.3.11'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon', # napoleon for google style docstring
'sphinx.ext.autosummary', # autosummary for generating summary
'sphinx.ext.viewcode', # viewcode for linking source code
'sphinx.ext.intersphinx', # intersphinx for linking to other projects
'sphinx.ext.graphviz', # graphviz for including graphviz/dot files
'nbsphinx', # nbsphinx for jupyter notebook
'IPython.sphinxext.ipython_console_highlighting', # ipython console highlighting
]

intersphinx_mapping = {
'IPython': ('https://ipython.readthedocs.io/en/stable/', None),
'matplotlib': ('https://matplotlib.org/', None),
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'pandas': ('https://pandas.pydata.org/docs/', None),
'python': ('https://docs.python.org/3/', None),
}

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

autodoc_member_order = 'bysource'

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

# html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
34 changes: 34 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. h3-toolkit documentation master file, created by
sphinx-quickstart on Wed Aug 21 21:49:46 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

.. _Polars: https://www.pola.rs
.. _h3ronpy: https://h3ronpy.org
.. _H3 spatial indexing system : https://h3geo.org/

h3-toolkit documentation
========================

Welcome to h3-toolkit

h3-toolkit is a Python library designed to streamline the process of working with Uber’s `H3 spatial indexing system`_ and Polars for high-performance data manipulation. This toolkit focuses on making data transformations between different H3 resolutions faster and more convenient.

With h3-toolkit, you can efficiently convert and aggregate geospatial data using H3 indexes, leveraging the power of Polars for swift data processing. Whether you are working with point, line, polygon, or raster data, this library simplifies the integration and manipulation of H3 spatial data, enhancing your workflow and productivity.

Key features include:

• Seamless Resolution Conversion: Easily transform data across different H3 resolutions.
• Optimized Performance: Utilize `Polars`_ and `h3ronpy`_ for fast and efficient data handling.
• Flexible Aggregation: Apply various aggregation functions to your geospatial data.

Get started with h3-toolkit to enhance your geospatial data processing and make working with H3 indexes more effective and efficient.

.. toctree::
:maxdepth: 3
:caption: Documentation

API Documentation <api/modules>
Usage Examples <usage/index>

.. Installation <>
4 changes: 4 additions & 0 deletions docs/source/usage/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POSTGRES =
HBASE_FETCH_API =
HBASE_SEND_API =
HBASE_TOKEN =
Loading