Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DiffusionGeometryJ
# DiffusionGeometryJL

Julia port of the Python `DiffusionGeometry` package — data-driven calculus,
geometry, and topology on point clouds via heat diffusion and the carré du champ
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "DiffusionGeometryJ"
name = "DiffusionGeometryJL"
uuid = "f8140dce-05b1-4e22-80fe-cf341a3061cb"
version = "0.1.0"
authors = ["Iolo Jones", "David Lanners"]
Expand All @@ -19,7 +19,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"

[extensions]
DiffusionGeometryJMakieExt = "Makie"
DiffusionGeometryJLMakieExt = "Makie"

[compat]
Convex = "0.16.6"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DiffusionGeometryJ
# DiffusionGeometryJL

Data-driven calculus, geometry, and topology on point clouds — via heat
diffusion and the carré du champ operator.
Expand All @@ -20,7 +20,7 @@ cite the original authors when using this software:

## What it does

Given nothing but a point cloud, `DiffusionGeometryJ` builds a discrete
Given nothing but a point cloud, `DiffusionGeometryJL` builds a discrete
approximation of the manifold the points are sampled from and lets you do
differential geometry on it: take gradients and Hessians, build the exact and
Hodge Laplacians on differential forms, measure lengths and angles with the
Expand All @@ -32,7 +32,7 @@ the heat diffusion of the data — no mesh, no charts, no prescribed metric.

```julia
using Pkg
Pkg.add(url="https://github.com/wardjm/DiffusionGeometryJ")
Pkg.add(url="https://github.com/wardjm/DiffusionGeometryJL")
```

Plotting is provided through a package extension that loads only when a
Expand All @@ -45,7 +45,7 @@ Pkg.add("GLMakie") # or CairoMakie
## Quick start

```julia
using DiffusionGeometryJ
using DiffusionGeometryJL

# a point cloud: n points in d ambient dimensions (n × d)
data = randn(200, 3)
Expand Down
4 changes: 2 additions & 2 deletions bench/bench.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env julia
# Timing benchmark for the Julia DiffusionGeometryJ tracer-bullet pipeline.
using DiffusionGeometryJ
# Timing benchmark for the Julia DiffusionGeometryJL tracer-bullet pipeline.
using DiffusionGeometryJL
using Random, Statistics, Printf

const SIZES = [200, 500, 1000, 2000, 3000, 5000]
Expand Down
2 changes: 1 addition & 1 deletion bench/bench_ops.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env julia
# Timing benchmark for the Julia operator-build path (weak-matrix contractions).
using DiffusionGeometryJ
using DiffusionGeometryJL
using Random, Statistics, Printf

const SIZES = [500, 1000, 2000, 3000, 5000]
Expand Down
4 changes: 2 additions & 2 deletions bench/betti_vs_ripserer.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compare DiffusionGeometryJ's `betti_numbers` against persistent homology
# Compare DiffusionGeometryJL's `betti_numbers` against persistent homology
# (Ripserer) on a few point clouds with known topology.
#
# Ripserer is NOT a dependency of this package. Run this in a scratch env:
Expand All @@ -17,7 +17,7 @@
# NOTE: `betti_numbers` needs the FULL coefficient basis
# (n_coefficients == n_function_basis) or the harmonic forms are truncated away.

using DiffusionGeometryJ
using DiffusionGeometryJL
using Ripserer
using Random

Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[deps]
DiffusionGeometryJ = "f8140dce-05b1-4e22-80fe-cf341a3061cb"
DiffusionGeometryJL = "f8140dce-05b1-4e22-80fe-cf341a3061cb"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Expand Down
4 changes: 2 additions & 2 deletions docs/doctest_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# hard to read. It is documented for the reader in `docs/src/index.md`.

const DOCTEST_SETUP = quote
using DiffusionGeometryJ
using DiffusionGeometryJL
using LinearAlgebra

# Nothing unexported is imported here on purpose. The internal helpers documented on
# the "Utilities" page (`np_reshape`, the batch helpers, `_from_pointwise_basis`) are
# *not* exported, so their examples spell them `DiffusionGeometryJ.np_reshape(...)` —
# *not* exported, so their examples spell them `DiffusionGeometryJL.np_reshape(...)` —
# as a reader would have to.

# 60 points on the unit circle in ℝ² — the running example. Its intrinsic
Expand Down
12 changes: 6 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using Documenter
using DiffusionGeometryJ
using DiffusionGeometryJL

include(joinpath(@__DIR__, "doctest_setup.jl"))
DocMeta.setdocmeta!(DiffusionGeometryJ, :DocTestSetup, DOCTEST_SETUP; recursive=true)
DocMeta.setdocmeta!(DiffusionGeometryJL, :DocTestSetup, DOCTEST_SETUP; recursive=true)

makedocs(;
sitename="DiffusionGeometryJ",
sitename="DiffusionGeometryJL",
authors="Jeffrey Ward",
modules=[DiffusionGeometryJ],
modules=[DiffusionGeometryJL],
doctest=true,
checkdocs=:exports, # every exported name must appear in an @docs block
# No `warnonly`: an undocumented export, a broken doctest or a dead cross-reference
# must fail the build, not warn.
format=Documenter.HTML(;
canonical="https://wardjm.github.io/DiffusionGeometryJ",
canonical="https://wardjm.github.io/DiffusionGeometryJL",
prettyurls=get(ENV, "CI", "false") == "true",
),
pages=[
Expand All @@ -32,4 +32,4 @@ makedocs(;
],
)

deploydocs(; repo="github.com/wardjm/DiffusionGeometryJ", devbranch="main")
deploydocs(; repo="github.com/wardjm/DiffusionGeometryJL", devbranch="main")
2 changes: 1 addition & 1 deletion docs/src/api/diffusion.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
```

# Diffusion core
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/geometry.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
DocTestSetup = Main.DOCTEST_SETUP
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/methods.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
```

# Numerical methods
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/operators.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
DocTestSetup = Main.DOCTEST_SETUP
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/tensors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
```

# Tensor fields
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/utils.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
```

# Utilities
Expand Down
4 changes: 2 additions & 2 deletions docs/src/conventions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
DocTestSetup = Main.DOCTEST_SETUP
```

Expand Down Expand Up @@ -41,7 +41,7 @@ carries its own [`broadcast_batch_shape`](@ref).
julia> batch_shape(dg_function(dg, ones(3, 60))) # three functions in one tensor
(3,)

julia> DiffusionGeometryJ.broadcast_batch_shape((3, 4), (4,)) # right-aligned
julia> DiffusionGeometryJL.broadcast_batch_shape((3, 4), (4,)) # right-aligned
(3, 4)
```

Expand Down
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
DocTestSetup = Main.DOCTEST_SETUP
```

# DiffusionGeometryJ
# DiffusionGeometryJL

Data-driven calculus, geometry, and topology on point clouds — via heat diffusion
and the carré du champ operator.
Expand All @@ -25,7 +25,7 @@ No mesh, no charts, no prescribed metric.

```julia
using Pkg
Pkg.add(url="https://github.com/wardjm/DiffusionGeometryJ")
Pkg.add(url="https://github.com/wardjm/DiffusionGeometryJL")
```

Plotting comes from a package extension that loads when a
Expand Down
4 changes: 2 additions & 2 deletions docs/src/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ functions exist but have no methods, and calling one prints a hint telling you t
load a backend.

```julia
using DiffusionGeometryJ
using DiffusionGeometryJL
using GLMakie # interactive; or CairoMakie for vector (PDF/SVG/PNG) output

dg = from_point_cloud(points)
Expand Down Expand Up @@ -111,7 +111,7 @@ deliberately absent:
## API

```@meta
CurrentModule = DiffusionGeometryJ
CurrentModule = DiffusionGeometryJL
```

The plot functions have no methods until a Makie backend is loaded, so their examples
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makie plotting for DiffusionGeometryJ.
# Makie plotting for DiffusionGeometryJL.
#
# Loaded automatically once the user loads Makie (via GLMakie, CairoMakie, …).
# Replaces the Python `diffusion_geometry/visualisation.py` and
Expand All @@ -7,7 +7,7 @@
# The plotting functions themselves are declared in `src/visualisation/api.jl`; the
# `@recipe` calls below add methods to *those* functions (the macro escapes the
# function name, so it extends the imported binding rather than shadowing it), which
# is what lets `DiffusionGeometryJ` export names an extension implements.
# is what lets `DiffusionGeometryJL` export names an extension implements.
#
# Three pieces of `visualisation.py` are deliberately not ported:
#
Expand All @@ -23,7 +23,7 @@
# and locks the aspect ratio of the axis it creates. `LScene` draws a 3D axis by default,
# so this is not something Makie gives for free.

module DiffusionGeometryJMakieExt
module DiffusionGeometryJLMakieExt

using Makie
using Makie: Point, Point2f, Point3f, Vec, Vec3f, lift, to_value
Expand All @@ -33,13 +33,13 @@ using Statistics: median, mean

const GeometryBasics = Makie.GeometryBasics

using DiffusionGeometryJ:
using DiffusionGeometryJL:
AbstractTensor, ScalarFunction, VectorField, Form, Tensor02, Tensor02Sym,
DIVERGING_COLORMAP, CYCLIC_COLORMAP,
ambient_dim, batch_shape, degree, full_tensor, geometry, hodge_star_2_form,
immersion_coords, to_ambient, to_pointwise_basis

import DiffusionGeometryJ:
import DiffusionGeometryJL:
dgplot, dgplot!, dgscatter, dgscatter!, dgquiver, dgquiver!,
dg2form, dg2form!, dg3form, dg3form!, dgellipsoids, dgellipsoids!,
dgeiglines, dgeiglines!, dgtangentplanes, dgtangentplanes!, dganimate
Expand Down
2 changes: 1 addition & 1 deletion src/DiffusionGeometryJ.jl → src/DiffusionGeometryJL.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module DiffusionGeometryJ
module DiffusionGeometryJL

# ── Phase 1: combinatorics + utils ────────────────────────────────────────────
include("utils/basis_utils.jl")
Expand Down
6 changes: 3 additions & 3 deletions src/tensors/base_tensor/base_tensor_space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ gram(space::AbstractTensorSpace) = gram(_u_coeffs(space.dg), cdc_components(spac

# Examples
```jldoctest
julia> DiffusionGeometryJ._is_orthonormal(function_space(dg))
julia> DiffusionGeometryJL._is_orthonormal(function_space(dg))
true

julia> DiffusionGeometryJ._is_orthonormal(vector_field_space(dg))
julia> DiffusionGeometryJL._is_orthonormal(vector_field_space(dg))
false
```
"""
Expand All @@ -149,7 +149,7 @@ but the weakest are two orders of magnitude down on the rest. Those are the ambi
directions *normal* to the circle, which the metric barely sees:

```jldoctest
julia> vals, vecs = DiffusionGeometryJ._gram_spectrum(vector_field_space(dg));
julia> vals, vecs = DiffusionGeometryJL._gram_spectrum(vector_field_space(dg));

julia> length(vals)
16
Expand Down
4 changes: 2 additions & 2 deletions src/utils/basis_conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ coefficients 2 and 3 are non-zero — and by Parseval they carry all of its L²
`∫cos²θ = 1/2`:

```jldoctest
julia> c = DiffusionGeometryJ._from_pointwise_basis(reshape(cos.(θ), 60, 1), function_space(dg));
julia> c = DiffusionGeometryJL._from_pointwise_basis(reshape(cos.(θ), 60, 1), function_space(dg));

julia> findall(>(1e-3), abs.(c)) # supported on the λ = 1 eigenspace alone
2-element Vector{Int64}:
Expand Down Expand Up @@ -75,7 +75,7 @@ Evaluating the coefficients of `f` back at the 60 sample points recovers `cos θ
to the error of the 8-function truncation:

```jldoctest
julia> values = DiffusionGeometryJ._to_pointwise_basis(f.coeffs, function_space(dg); basis_count=8);
julia> values = DiffusionGeometryJL._to_pointwise_basis(f.coeffs, function_space(dg); basis_count=8);

julia> size(values)
(60,)
Expand Down
Loading
Loading