cds-moc-rust
MOC library in Rust; used in MOCPy, a CLI, a WASM lib, ...
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.3%) to scientific vocabulary
Repository
MOC library in Rust; used in MOCPy, a CLI, a WASM lib, ...
Basic Info
- Host: GitHub
- Owner: cds-astro
- License: apache-2.0
- Language: Rust
- Default Branch: main
- Size: 43.6 MB
Statistics
- Stars: 7
- Watchers: 5
- Forks: 7
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
moc
Read, write, create and manipulate HEALPix Multi-Order Coverage maps (MOCs), i.e. discretized geomatrical surfaces on the unit sphere.
MOC Lib Rust, the Rust MOC library used in: * MOCPy, * MOCli; * MOCSet; * MOCWasm; * Aladin Lite V3; see the Cargo.tom file.
MOC Lib Rust rely on the CDS HEALPix Rust library.
About
This Rust library implements the v2.0 of the MOC standard,
including (S-)MOCs, T-MOCs and ST-MOCs.
It also implements F-MOCs (F for Frequency) and SF-MOCs.
MOC Lib Rust is used in: * MOCPy, a Python wrapper to manipulate MOCs; * a standalone command line tool MOCli for linux, MacOS and Windows; * a standalone command line tool MOCSet for linux, MacOS and Windows; * a WASM library MOCWasm to be used in web browsers.
For tools able to display MOCs, see: * the Aladin Desktop sky atlas in Java (also supports MOC operations); * Aladin Lite, "a lightweight version of the Aladin Sky Atlas running in the browser"; * MOCPy scripts, a python wrapper using the very same Rust MOC library.
Release
The github releases section number is the MOCCli, MOCSet and MOCWasm release number.
Install/test
Install rust
(and check that ~/.cargo/bin/ is in your path),
or update the Rust compiler with:
bash
rustup update
Run tests (with or without seeing stdout):
bash
cargo test
cargo test -- --nocapture
Run benches:
bash
cargo bench
Build documentation
bash
cargo doc --open
Build the library for fast test or final build ```bash
Fast build (large not optimized file)
cargo build
Optimized file
cargo build --release ```
Particularities
- The core of this library is very generic
- We implemented lazy, streamed operations:
- an operation between 2 MOCs takes in input 2 iterators and returns an iterator (streaming)
- you can combine operations by combining iterators at no cost;
the process start when starting to iterate on the outermost iterator (lazyness)
rust // Signature of the Union operation between 2 2D-MOCs pub fn or<T, Q, U, R, I1, J1, K1, I2, J2, K2>( left_it: K1, right_it: K2 ) -> OrRange2Iter<T, Q, I1, I2> where T: Idx, // Type of the 1st quantity (e.g. u32 or u64) Q: MocQty<T>, // First quantity type, e.g Time U: Idx, // Type of the 2nd quantity (e.g. u32 or u64) R: MocQty<U>, // Second quantity type, e.g Space (we use Hpx for HEALPix) I1: RangeMOCIterator<T, Qty=Q>, J1: RangeMOCIterator<U, Qty=R>, K1: RangeMOC2ElemIt<T, Q, U, R, It1=I1, It2=J1>, I2: RangeMOCIterator<T, Qty=Q>, J2: RangeMOCIterator<U, Qty=R>, K2: RangeMOC2ElemIt<T, Q, U, R, It1=I2, It2=J2>
Possible Enhancements / Ideas
- [ ] Add operations on
RangeMOC2- [X]
or - [ ]
and,complement,fold, ...
- [X]
- [X] Implement a function dividing a disjoint MOCs into a list of joint MOCs (tip: use the order and the flag of a BMOC, the flag telling is the cell has already been visited).
- [ ] Implement the compact notation (bits coding quad-tree traversal) for S-MOCs (binary + ASCII Base 64)
- [ ] Implement compact S-MOC: single z-order curve sorted array of indices with a 2 bits flag telling whether the index is a single index, a range lower bound or a range upper bound
- [ ] Make a PostgresQL wrapper using e.g. pgx?
WARNING about the STC-S to MOC function
STC-S parsing is ensured by the STC crate.
Current discrepancies between the STC standard and this implementation:
- The
DIFFERENCEoperation has been implemented as being asymmetric difference- why? probably because:
- I am biased towards Boolean algebra, it as
XOR(exclusiveORor symmetric difference) but noDifference - I read parts of the STC standard after the STC-S implementation
XORis already implemented in cdshleapix, butDIFFERENCEis not.
- I am biased towards Boolean algebra, it as
- has stated in the STC standard:
R1 – R2 = R1 AND (NOT R2)); but also:R1 - R2 = R1 AND (R1 XOR R2), andXOR = (R1 OR R2) AND (NOT (R1 AND R2))is more complex thatDIFFERENCE(so is worth having implented?).
- why? probably because:
- For
Polygon: we do not use the STC convention- we support self-intersecting polygons
- we generally return the smallest area polygon (use
NOTto get its complement!) - one convention could be to use an additional (last) provided points as a control point
- note that for convex polygons, the control point could be the vertices gravity center
- in a GUI, a user could define the inner part of the polygon by a final click
- why?
- efficient algorithms dealing with polygons supports self-intersecting polygons
- to support arbitrary defined polygons by a user clicking in a viewer such as Aladin or Aladin Lite
- cdshleapix is based on self-intersecting polygons
- For
Box: a position angle can be added as a last parameter, right afterbsize.
So far, we reject STC-S having:
* a frame different from ICRS
* a flavor different from Spher2
* units different from degrees
License
Like most projects in Rust, this project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Warning
The code is formatted using 2 tab spaces instead of the regular 4:
bash
cargo fmt -- --config tab_spaces=2
Acknowledgements
This work has been partly supported by the ESCAPE project.
ESCAPE - The European Science Cluster of Astronomy & Particle Physics ESFRI Research Infrastructures -
has received funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement no. 824064.
Owner
- Name: CDS (Centre de Données astronomiques de Strasbourg)
- Login: cds-astro
- Kind: organization
- Website: http://cds.unistra.fr/
- Repositories: 31
- Profile: https://github.com/cds-astro
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/MIT",
"codeRepository": "https://github.com/cds-astro/cds-moc-rust",
"contIntegration": "https://github.com/cds-astro/cds-moc-rust/actions",
"dateCreated": "2021-08-16",
"datePublished": "2021-10-18",
"dateModified": "2022-04-13",
"downloadUrl": "https://github.com/cds-astro/cds-moc-rust/releases",
"issueTracker": "https://github.com/cds-astro/cds-moc-rust/issues",
"name": "MOC Lib Rust, MOCCLi, MOCWasm and MOCSet",
"softwareVersion": "0.6.0",
"description": "Rust implementation of the IVOA MOC standard (MOC Lib Rust); \nassociated command line tool (MOCCli) and\nJavascript/WebAssembly wrapper to manipulate MOCs in Web Browsers (MOCWasm).",
"applicationCategory": "Astronomy",
"releaseNotes": "https://github.com/cds-astro/cds-moc-rust/blob/main/CHANGELOG.md",
"readme": "https://github.com/cds-astro/cds-moc-rust/blob/main/README.md",
"funding": "ESCAPE: European Science Cluster of Astronomy & Particle physics ESFRI research infrastructures",
"developmentStatus": "active",
"funder": [
{
"@type": "Organization",
"name": "Universit de Strasbourg"
},
{
"@type": "Organization",
"name": "European Commission",
"@id": "https://doi.org/10.13039/501100000780"
}
],
"keywords": [
"astronomy",
"IVOA",
"MOC",
"HEALPix"
],
"programmingLanguage": [
"Rust"
],
"operatingSystem": [
"Linux",
"Mac",
"Windows"
],
"author": [
{
"@type": "Person",
"@id": "http://orcid.org/0000-0002-2335-4499",
"givenName": "Francois-Xavier",
"familyName": "Pineau",
"email": "francois-xavier.pineau@astro.unistra.fr",
"affiliation": {
"@type": "Organization",
"name": "Universit de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR7550"
}
}
],
"maintainer": {
"@type": "Person",
"@id": "http://orcid.org/0000-0002-2335-4499",
"givenName": "Francois-Xavier",
"familyName": "Pineau",
"email": "francois-xavier.pineau@astro.unistra.fr",
"affiliation": {
"@type": "Organization",
"name": "Universit de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR7550"
}
},
"contributor": [
{
"@type": "Person",
"givenName": "Matthieu",
"familyName": "Baumann",
"email": "matthieu.baumann@astro.unistra.fr",
"affiliation": {
"@type": "Organization",
"name": "Universit de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR7550"
}
}
]
}
GitHub Events
Total
- Create event: 2
- Release event: 2
- Issues event: 4
- Watch event: 1
- Issue comment event: 4
- Push event: 23
Last Year
- Create event: 2
- Release event: 2
- Issues event: 4
- Watch event: 1
- Issue comment event: 4
- Push event: 23
Committers
Last synced: about 3 years ago
All Time
- Total Commits: 119
- Total Committers: 1
- Avg Commits per committer: 119.0
- Development Distribution Score (DDS): 0.0
Top Committers
| Name | Commits | |
|---|---|---|
| fxpineau | f****u@a****r | 119 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 9
- Total pull requests: 3
- Average time to close issues: 2 months
- Average time to close pull requests: about 2 months
- Total issue authors: 5
- Total pull request authors: 2
- Average comments per issue: 1.22
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 0
- Average time to close issues: 2 months
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 0
- Average comments per issue: 1.33
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ManonMarchand (4)
- bmatthieu3 (2)
- fxpineau (1)
- keewis (1)
- robyww (1)
Pull Request Authors
- bmatthieu3 (3)
- fxpineau (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- criterion 0.3 development
- rand 0.8.3 development
- byteorder 1.4.3
- flate2 1.0.22
- healpix 0.6.3
- nom 6.1.2
- num 0.4
- quick-error 2.0.1
- rayon 1.5.1
- serde_json 1.0
- wasm-bindgen-test 0.3.0 development
- console_error_panic_hook 0.1.7
- healpix 0.6.3
- js-sys 0.3.52
- serde 1.0.80
- unreachable 0.1
- wasm-bindgen 0.2.78
- wasm-bindgen-futures 0.4.28
- web-sys 0.3.52
- actions/checkout v2 composite
- actions/checkout v2 composite
- actions/checkout v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions-rs/cargo v1 composite
- actions-rs/toolchain v1 composite
- actions/checkout v2 composite
- actions/create-release v1 composite
- actions/upload-release-asset v1 composite
- actions/checkout v2 composite
- actions/checkout v2 composite