Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Rename package to mogeo 🌎 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
guidorice authored Dec 17, 2023
1 parent 4a5c71f commit b302043
Show file tree
Hide file tree
Showing 63 changed files with 104 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
modular auth ${{secrets.MODULAR_AUTH}} && \
modular install mojo
- name: "Setup conda env (geo-features)"
- name: "Setup conda env (mogeo)"
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
activate-environment: geo-features
activate-environment: mogeo
environment-file: environment.yml

- name: "Run mojo-pytest"
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "geo_features/test/fixtures/geoarrow/geoarrow-data"]
path = geo_features/test/fixtures/geoarrow/geoarrow-data
url = https://github.com/geoarrow/geoarrow-data
[submodule "mogeo/test/fixtures/geoarrow/geoarrow-data"]
path = mogeo/test/fixtures/geoarrow/geoarrow-data
url = https://github.com/geoarrow/geoarrow-data.git
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ install-py-packages:
conda env create -p venv --file environment.yml

clean:
rm -rf ~/.modular/.mojo_cache build/geo_features.mojopkg
rm -rf ~/.modular/.mojo_cache build/mogeo.mojopkg

test:
pytest -W error
Expand All @@ -14,4 +14,4 @@ format:

package:
mkdir -p build/
mojo package geo_features/ -o build/geo_features.mojopkg
mojo package mogeo/ -o build/mogeo.mojopkg
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# geo-features
# MoGeo: Mojo Geospatial/Geometric Package

[![Run Tests](https://github.com/guidorice/geo-features/actions/workflows/tests.yaml/badge.svg)](https://github.com/guidorice/geo-features/actions/workflows/tests.yaml)
[![Run Tests](https://github.com/guidorice/mogeo/actions/workflows/tests.yaml/badge.svg)](https://github.com/guidorice/mogeo/actions/workflows/tests.yaml)

[MojoπŸ”₯](https://github.com/modularml/mojo) package for geographic or geometric
vector features, for example: location data or earth observation data. It is
Expand Down Expand Up @@ -90,16 +90,16 @@ efficient representation of coordinates, features and attributes.
1. Clone this repo, including submodules:

```shell
git clone --recurse-submodules https://github.com/guidorice/geo-features
git clone --recurse-submodules https://github.com/guidorice/mogeo
```

2. Create a Python environment using [environment.yml](./environment.yml). This is required for supporting packages used
by `geo-features`, for example for interchange, serialization, and unit testing.
by `mogeo`, for example for interchange, serialization, and unit testing.
[Conda](https://docs.conda.io/projects/miniconda/en/latest/) is recommended because it puts a copy of libpython into
each conda env.

```text
conda env create -n geo-features --file environment.yml
conda env create -n mogeo --file environment.yml
```

3. Set `MOJO_PYTHON_LIBRARY` environment variable to your libpython. An example of doing
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: geo-features
name: mogeo
channels:
- defaults
dependencies:
Expand Down
15 changes: 0 additions & 15 deletions geo_features/__init__.mojo

This file was deleted.

3 changes: 0 additions & 3 deletions geo_features/bench/__init__.mojo

This file was deleted.

Empty file removed geo_features/geog/__init__.mojo
Empty file.
8 changes: 0 additions & 8 deletions geo_features/geom/__init__.mojo

This file was deleted.

Empty file removed geo_features/test/__init__.mojo
Empty file.
Empty file.
3 changes: 0 additions & 3 deletions geo_features/test/geog/__init__.mojo

This file was deleted.

3 changes: 0 additions & 3 deletions geo_features/test/geom/__init__.mojo

This file was deleted.

Empty file removed geo_features/util/__init__.mojo
Empty file.
3 changes: 3 additions & 0 deletions mogeo/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
MoGeo: Mojo Geospatial/Geometric Package
"""
3 changes: 3 additions & 0 deletions mogeo/algo/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Algorithms module.
"""
3 changes: 3 additions & 0 deletions mogeo/bench/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Benchmarks module.
"""
3 changes: 3 additions & 0 deletions mogeo/geog/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Geographic module.
"""
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions mogeo/geom/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Geometric module.
"""
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions geo_features/geom/envelope.mojo β†’ mogeo/geom/envelope.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ from algorithm.functional import parallelize
import math
from tensor import Tensor

from geo_features.geom.empty import empty_value, is_empty
from geo_features.geom.point import Point
from geo_features.geom.enums import CoordDims
from geo_features.geom.layout import Layout
from geo_features.geom.traits import Geometric, Emptyable
from geo_features.serialization.traits import JSONable, WKTable, Geoarrowable
from geo_features.serialization import (
from mogeo.geom.empty import empty_value, is_empty
from mogeo.geom.point import Point
from mogeo.geom.enums import CoordDims
from mogeo.geom.layout import Layout
from mogeo.geom.traits import Geometric, Emptyable
from mogeo.serialization.traits import JSONable, WKTable, Geoarrowable
from mogeo.serialization import (
WKTParser,
JSONParser,
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ from utils.vector import DynamicVector
from memory import memcmp
from python import Python

from geo_features.serialization import WKTParser, JSONParser
from geo_features.geom.point import Point
from geo_features.geom.layout import Layout
from geo_features.geom.enums import CoordDims
from geo_features.geom.empty import is_empty, empty_value
from geo_features.geom.traits import Geometric, Emptyable
from geo_features.serialization.traits import WKTable, JSONable, Geoarrowable
from geo_features.serialization import (
from mogeo.serialization import WKTParser, JSONParser
from mogeo.geom.point import Point
from mogeo.geom.layout import Layout
from mogeo.geom.enums import CoordDims
from mogeo.geom.empty import is_empty, empty_value
from mogeo.geom.traits import Geometric, Emptyable
from mogeo.serialization.traits import WKTable, JSONable, Geoarrowable
from mogeo.serialization import (
WKTParser,
JSONParser,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ from utils.vector import DynamicVector
from memory import memcmp
from python import Python

from geo_features.serialization import WKTParser, JSONParser
from geo_features.geom.layout import Layout
from geo_features.geom.empty import is_empty, empty_value
from geo_features.geom.traits import Geometric, Emptyable
from geo_features.geom.point import Point
from geo_features.geom.enums import CoordDims
from geo_features.serialization.traits import WKTable, JSONable, Geoarrowable
from geo_features.serialization import (
from mogeo.serialization import WKTParser, JSONParser
from mogeo.geom.layout import Layout
from mogeo.geom.empty import is_empty, empty_value
from mogeo.geom.traits import Geometric, Emptyable
from mogeo.geom.point import Point
from mogeo.geom.enums import CoordDims
from mogeo.serialization.traits import WKTable, JSONable, Geoarrowable
from mogeo.serialization import (
WKTParser,
JSONParser,
)
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions geo_features/geom/point.mojo β†’ mogeo/geom/point.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ from python import Python
from math import nan, isnan
from math.limit import max_finite

from geo_features.geom.empty import empty_value, is_empty
from geo_features.geom.envelope import Envelope
from geo_features.serialization.traits import WKTable, JSONable, Geoarrowable
from geo_features.serialization import (
from mogeo.geom.empty import empty_value, is_empty
from mogeo.geom.envelope import Envelope
from mogeo.serialization.traits import WKTable, JSONable, Geoarrowable
from mogeo.serialization import (
WKTParser,
JSONParser,
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Interchange, parsers, and serialization formats.
Serialization module.
"""

from .json import *
from .wkt import *
from .geoarrow import *
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions mogeo/test/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Test module.
"""
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions mogeo/test/geog/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Tests for mogeo/geog module.
"""
3 changes: 3 additions & 0 deletions mogeo/test/geom/__init__.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Tests for mogeo/geom module.
"""
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from geo_features.geom.empty import empty_value, is_empty
from geo_features.test.pytest import MojoTest
from mogeo.geom.empty import empty_value, is_empty
from mogeo.test.pytest import MojoTest


fn main() raises:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ from python import Python
from python.object import PythonObject
from pathlib import Path

from geo_features.geom.empty import empty_value, is_empty
from geo_features.test.pytest import MojoTest
from geo_features.geom.enums import CoordDims
from mogeo.geom.empty import empty_value, is_empty
from mogeo.test.pytest import MojoTest
from mogeo.geom.enums import CoordDims


fn main() raises:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ from utils.vector import DynamicVector
from pathlib import Path
from random import rand

from geo_features.test.pytest import MojoTest
from geo_features.test.constants import lon, lat, height, measure
from mogeo.test.pytest import MojoTest
from mogeo.test.constants import lon, lat, height, measure

from geo_features.geom.envelope import Envelope
from geo_features.geom.point import Point
from geo_features.geom.enums import CoordDims
from geo_features.geom.layout import Layout
from geo_features.geom.traits import Geometric, Emptyable
from mogeo.geom.envelope import Envelope
from mogeo.geom.point import Point
from mogeo.geom.enums import CoordDims
from mogeo.geom.layout import Layout
from mogeo.geom.traits import Geometric, Emptyable


fn main() raises:
Expand Down Expand Up @@ -181,7 +181,7 @@ fn test_with_geos() raises:

# LineString

# let path = Path("geo_features/test/fixtures/geojson/line_string")
# let path = Path("mogeo/test/fixtures/geojson/line_string")
# let fixtures = VariadicList("curved.geojson", "straight.geojson", "zigzag.geojson")
# for i in range(len(fixtures)):
# let file = path / fixtures[i]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from tensor import Tensor, TensorSpec, TensorShape
from utils.index import Index

from geo_features.test.pytest import MojoTest
from geo_features.geom.layout import Layout
from geo_features.test.constants import lat, lon, height, measure
from geo_features.geom.enums import CoordDims
from mogeo.test.pytest import MojoTest
from mogeo.geom.layout import Layout
from mogeo.test.constants import lat, lon, height, measure
from mogeo.geom.enums import CoordDims


fn main() raises:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ from utils.vector import DynamicVector
from utils.index import Index
from pathlib import Path

from geo_features.test.pytest import MojoTest
from geo_features.test.constants import lon, lat, height, measure
from geo_features.geom.point import Point, Point64
from geo_features.geom.line_string import LineString
from mogeo.test.pytest import MojoTest
from mogeo.test.constants import lon, lat, height, measure
from mogeo.geom.point import Point, Point64
from mogeo.geom.line_string import LineString


fn main() raises:
Expand Down Expand Up @@ -233,7 +233,7 @@ fn test_from_json() raises:

let json = Python.import_module("orjson")
let builtins = Python.import_module("builtins")
let path = Path("geo_features/test/fixtures/geojson/line_string")
let path = Path("mogeo/test/fixtures/geojson/line_string")
let fixtures = VariadicList("curved.geojson", "straight.geojson", "zigzag.geojson")

for i in range(len(fixtures)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ from utils.vector import DynamicVector
from utils.index import Index
from pathlib import Path

from geo_features.test.constants import lat, lon, height, measure
from geo_features.test.pytest import MojoTest
from geo_features.geom.point import Point, Point64
from geo_features.geom.multi_point import MultiPoint
from geo_features.serialization.json import JSONParser
from geo_features.geom.enums import CoordDims
from mogeo.test.constants import lat, lon, height, measure
from mogeo.test.pytest import MojoTest
from mogeo.geom.point import Point, Point64
from mogeo.geom.multi_point import MultiPoint
from mogeo.serialization.json import JSONParser
from mogeo.geom.enums import CoordDims


fn main() raises:
Expand Down Expand Up @@ -160,7 +160,7 @@ fn test_stringable() raises:

fn test_wktable() raises:
let test = MojoTest("wktable")
let path = Path("geo_features/test/fixtures/wkt/multi_point")
let path = Path("mogeo/test/fixtures/wkt/multi_point")
let fixtures = VariadicList("point.wkt", "point_z.wkt")
for i in range(len(fixtures)):
let file = path / fixtures[i]
Expand Down Expand Up @@ -218,7 +218,7 @@ fn test_from_json() raises:
pass
# let test = MojoTest("from_json")

# let path = Path("geo_features/test/fixtures/geojson/multi_point")
# let path = Path("mogeo/test/fixtures/geojson/multi_point")
# let fixtures = VariadicList("multi_point.geojson") # , "multi_point_z.geojson"
# for i in range(len(fixtures)):
# let file = path / fixtures[i]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ from python import Python
from python.object import PythonObject
from pathlib import Path

from geo_features.geom.empty import empty_value, is_empty
from geo_features.geom.point import Point, CoordDims
from geo_features.geom.traits import Dimensionable, Geometric, Emptyable
from geo_features.test.helpers import load_geoarrow_test_fixture
from geo_features.test.pytest import MojoTest
from geo_features.test.constants import lon, lat, height, measure
from mogeo.geom.empty import empty_value, is_empty
from mogeo.geom.point import Point, CoordDims
from mogeo.geom.traits import Dimensionable, Geometric, Emptyable
from mogeo.test.helpers import load_geoarrow_test_fixture
from mogeo.test.pytest import MojoTest
from mogeo.test.constants import lon, lat, height, measure


fn main() raises:
Expand Down Expand Up @@ -307,7 +307,7 @@ fn test_wkt() raises:
fn test_from_wkt() raises:
let test = MojoTest("from_wkt")

let path = Path("geo_features/test/fixtures/wkt/point/point.wkt")
let path = Path("mogeo/test/fixtures/wkt/point/point.wkt")
let wkt: String
with open(path, "rb") as f:
wkt = f.read()
Expand Down Expand Up @@ -357,7 +357,7 @@ fn test_from_geoarrow() raises:
let test = MojoTest("from_geoarrow")

let ga = Python.import_module("geoarrow.pyarrow")
let path = Path("geo_features/test/fixtures/geoarrow/geoarrow-data/example")
let path = Path("mogeo/test/fixtures/geoarrow/geoarrow-data/example")
let empty = empty_value[DType.float64]()
var file = path / "example-point.arrow"
var table = load_geoarrow_test_fixture(file)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b302043

Please sign in to comment.