Skip to content

Commit

Permalink
Factor out primitives and types to GeometryOpsCore.jl (#220)
Browse files Browse the repository at this point in the history
* Factor all core stuff out into a GeometryOpsCore package

This basically guts the `types.jl` and `primitives.jl` files from GeometryOps and puts them into a new, low-dependency module that other packages can utilize for a convenient structure.

* Define `Manifold` and subtypes Linear, Spherical, Geodesic

The name `Manifold` is up for debate, I just wanted some supertype for dispatch constraints.

* Fix integration issues, get things working

* Fix import error

* Finish Project.toml and README

* Get docs to cover core + extensions also

* Fix typo

* push things properly

* amend paths too

* fix again
  • Loading branch information
asinghvi17 authored Oct 3, 2024
1 parent 8dcb76e commit afa9f86
Show file tree
Hide file tree
Showing 16 changed files with 922 additions and 719 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/Manifest.toml
/GeometryOpsCore/Manifest.toml
/docs/build/
/docs/src/source/
.vscode/
Expand Down
9 changes: 9 additions & 0 deletions GeometryOpsCore/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name = "GeometryOpsCore"
uuid = "05efe853-fabf-41c8-927e-7063c8b9f013"
authors = ["Anshul Singhvi <[email protected]> and contributors"]
version = "0.1.0"

[deps]
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
8 changes: 8 additions & 0 deletions GeometryOpsCore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# GeometryOpsCore

This is a "core" package for [GeometryOps.jl](https://github.com/JuliaGeo/GeometryOps.jl), that defines some basic primitive functions and types for GeometryOps.

Generally, you would depend on this to use either the GeometryOps types (like `Linear`, `Spherical`, etc) or the primitive functions like `apply`, `applyreduce`, `flatten`, etc.
All of these are also accessible from GeometryOps, so it's preferable that you use GeometryOps directly.

Tests are in the main GeometryOps tests, we don't have separate tests for GeometryOpsCore since it's in a monorepo structure.
28 changes: 28 additions & 0 deletions GeometryOpsCore/src/GeometryOpsCore.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module GeometryOpsCore

using Base.Threads: nthreads, @threads, @spawn

import GeoInterface
import GeoInterface as GI
import GeoInterface: Extents

# Import all names from GeoInterface and Extents, so users can do `GO.extent` or `GO.trait`.
for name in names(GeoInterface)
@eval using GeoInterface: $name
end
for name in names(Extents)
@eval using GeoInterface.Extents: $name
end

using Tables
using DataAPI

include("keyword_docs.jl")
include("types.jl")

include("apply.jl")
include("applyreduce.jl")
include("other_primitives.jl")
include("geometry_utils.jl")

end
Loading

2 comments on commit afa9f86

@asinghvi17
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register subdir=GeometryOpsCore

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/116495

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a GeometryOpsCore-v0.1.0 -m "<description of version>" afa9f862f4905ae9e3fd85b1cb514a0f5944655d
git push origin GeometryOpsCore-v0.1.0

Please sign in to comment.