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

Prepare 0.5.0 #33

Merged
merged 3 commits into from
Nov 17, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and Check

on:
push:
branches: ['master']
branches: ['main']
pull_request:
branches: ['master']
branches: ['main']

env:
CARGO_TERM_COLOR: always
Expand Down
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- ## [Unreleased] -->

## [0.5.0-beta.6] - 2023-11-16
## [0.5.0] - 2023-11-17

### Fixed
### Added

CI Script for publishing to Github npm registry
- Support for NTv2 Grids with multiple subgrids via [Geodesy:#74](https://github.com/busstoptaktik/geodesy/pull/74)
- General clean ups and re-org i.e rename `Ctx` -> `Geo`

## [0.5.0-beta.[2->6]] - 2023-11-16

Iteration to get teh CI publishing working

## [0.5.0-beta.1] - 2023-11-14

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "geodesy-wasm"
version = "0.5.0-beta.6"
version = "0.5.0"
keywords = ["geospatial", "geodesy", "cartography", "geography"]
categories = ["science"]
authors = ["Sean Rennie <[email protected]>"]
Expand All @@ -20,7 +20,7 @@ default = ["console_error_panic_hook", "console_log"]
[dependencies]
wasm-bindgen = "0.2.86"

geodesy_rs = { package = "geodesy", git = "https://github.com/Rennzie/geodesy.git", rev = "441651cc768276ba539232ed33f23f0ac4dde921", version = "0.10.0", features = [
geodesy_rs = { package = "geodesy", git = "https://github.com/Rennzie/geodesy.git", rev = "17d04f29b2d28f72ee83006f654aaf3664839456", version = "0.10.0", features = [
"js",
] }

Expand Down
4 changes: 2 additions & 2 deletions js/geodesy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as GeodesyWasm from '@geodesy-wasm';

export class Geodesy {
private ctx: GeodesyWasm.Ctx;
private ctx: GeodesyWasm.Geo;

/**
* The `Geodesy` class wraps the geodesy-wasm library and provides a simpler JS friendly interface that abstracts some of the wasmness out of it.
Expand All @@ -26,7 +26,7 @@ export class Geodesy {
}
}

this.ctx = new GeodesyWasm.Ctx(tidyProjString(definition), gridLoader);
this.ctx = new GeodesyWasm.Geo(tidyProjString(definition), gridLoader);

// TODO: How do we cleanup wasm memory if the class is GC'd?
}
Expand Down
8 changes: 5 additions & 3 deletions src/geodesy/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ use crate::error::WasmResult;
use geodesy_rs::{authoring::parse_proj, prelude::*};
use wasm_bindgen::prelude::*;

/// A wrapper around a Geodesy Context
/// This is the main entry point for the library.
#[wasm_bindgen]
pub struct Ctx {
pub struct Geo {
context: WasmContext,
op_handle: OpHandle,
}

#[wasm_bindgen]
impl Ctx {
impl Geo {
#[wasm_bindgen(constructor)]
pub fn new(definition: &str, grids: Option<GridLoader>) -> WasmResult<Ctx> {
pub fn new(definition: &str, grids: Option<GridLoader>) -> WasmResult<Geo> {
let mut context = WasmContext::new();

let mut geodesy_def = definition.to_owned();
Expand Down
2 changes: 1 addition & 1 deletion src/geodesy/coordinate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct CoordBuffer(#[wasm_bindgen(skip)] pub CoordSetBuffer);

#[wasm_bindgen]
impl CoordBuffer {
/// Creates a new CoordBuffer from a JS array of f64 values.
/// Creates a new [CoordBuffer] from a JS array of f64 values.
/// The array should be flat and contain either 2D or 3D coordinates.
/// Note: If you are providing angular coordinates, they MUST be in radians AND
/// it's assumed they are in the order (longitude, latitude, height) OR (easting, northing, height).
Expand Down
6 changes: 3 additions & 3 deletions src/geodesy/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use std::{
};
use wasm_bindgen::prelude::*;

/// A helper class for loading gridshift files into the `Ctx` class.
/// The class is consumed in the `Ctx` new method to ensure we don't double the memory usage.
/// It is therefore not safe to use this class after the `Ctx` has been created.
/// A helper class for loading gridshift files into the [Geo] class.
/// The class is consumed in the [Geo#new()] method to ensure we don't double the memory usage.
/// It's therefore not safe to use this class after [Geo] has been constructed.
#[wasm_bindgen]
pub struct GridLoader(BTreeMap<String, Arc<dyn Grid>>);

Expand Down
4 changes: 2 additions & 2 deletions src/geodesy/operators/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use geodesy_rs::authoring::*;

mod noop;
mod unitconvert;
pub mod units;

use geodesy_rs::authoring::*;

#[rustfmt::skip]
pub const ACCESSORY_OPERATORS: [(&str, OpConstructor); 5] = [
("unitconvert", OpConstructor(unitconvert::new)),
Expand Down
2 changes: 1 addition & 1 deletion src/geodesy/wasmcontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct WasmContext {
resources: BTreeMap<String, String>,
/// Instantiations of operators
operators: BTreeMap<OpHandle, Op>,
/// DataViews for external resources like grids
/// Single Grid store for use by operators
grids: BTreeMap<String, Arc<dyn Grid>>,
}

Expand Down