Skip to content

Commit

Permalink
Fix negative argument error in moc-set, bump to v0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fxpineau committed Sep 12, 2022
1 parent 36f0ad6 commit 4a00dec
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 6 deletions.
6 changes: 6 additions & 0 deletions crates/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# `moc-cli` Change Log


## 0.5.2

Realeased 2022-09-12


## 0.5.1

Realeased 2022-09-09
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "moc-cli"
version = "0.5.1"
version = "0.5.2"
authors = ["F.-X. Pineau <[email protected]>"]
description = "Command-line to create and manipulate HEALPix Multi-Order Coverages maps (MOCs)"
license = "MIT OR Apache-2.0"
Expand Down
9 changes: 9 additions & 0 deletions crates/set/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `moc-set` Change Log

## 0.5.2

Released 2022-09-12.

### Bug correction

* Accept negative number in arguments


## 0.5.1

Released 2022-09-09.
Expand Down
2 changes: 1 addition & 1 deletion crates/set/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "moc-set"
version = "0.5.1"
version = "0.5.2"
authors = ["F.-X. Pineau <[email protected]>"]
description = "command-line tool to build, update and query a persistent set of HEALPix Multi-Order Coverages maps (MOCs)"
license = "MIT OR Apache-2.0"
Expand Down
12 changes: 11 additions & 1 deletion crates/set/resources/tests/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ query_cone_valid(){
assert_eq "${actual}" "${expected}" "query cone 0.0 +0.0 0.1"
}

query_cone_negdec_valid(){
local cmd="cargo run --release -- query ${mocset} cone 10.0 -12.0 0.1"
local actual=$(${cmd} | tr '\n' ' ' | sed -r 's/ +$//')
local expected="id"
assert_eq "${actual}" "${expected}" "query cone 10.0 -12.0 0.1"
}


query_cone_valid_prec6(){
local cmd="cargo run --release -- query ${mocset} cone 0.0 +0.0 0.1 --precision 6"
local actual=$(${cmd} | tr '\n' ' ' | sed -r 's/ +$//')
Expand Down Expand Up @@ -105,6 +113,7 @@ list1
query_cone_valid
query_cone_valid_with_coverage
query_cone_valid_prec6
query_cone_negdec_valid
#cargo run --release list --ranges mocset.bin
cargo run --release purge mocset.bin
#cargo run --release list --ranges mocset.bin
Expand All @@ -124,7 +133,8 @@ query_cone_deprecated_withdeprect
cargo run --release chgstatus mocset.bin 161 removed
query_cone_removed_nodeprec
query_cone_removed_withdeprec
cargo run --release append mocset.bin 161 data/CDS_J_ApJ_811_30_table3.fits
cargo run --release append mocset.bin -161 data/CDS_J_ApJ_811_30_table3.fits
cargo run --release chgstatus mocset.bin 161 valid
cargo run --release purge mocset.bin
query_cone_valid
query_cone_valid_with_coverage
Expand Down
1 change: 1 addition & 0 deletions crates/set/src/append.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::{
};

#[derive(Debug, Parser)]
#[clap(allow_negative_numbers = true)]
/// Append the given MOCs to an existing mocset
pub struct Append {
#[clap(parse(from_os_str))]
Expand Down
4 changes: 2 additions & 2 deletions crates/set/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ pub struct Query {

#[derive(Debug, Parser)]
pub enum Region {
#[clap(name = "pos")]
#[clap(name = "pos", allow_negative_numbers = true)]
/// Single position.
Pos {
/// Longitude of the cone center (in degrees)
lon_deg: f64,
/// Latitude of the cone center (in degrees)
lat_deg: f64,
},
#[clap(name = "cone")]
#[clap(name = "cone", allow_negative_numbers = true)]
/// A cone, i.e. a position with a small area around (approximated by a MOC).
Cone {
/// Longitude of the cone center (in degrees)
Expand Down
5 changes: 5 additions & 0 deletions crates/wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# `moc-wasm` Change Log

## 0.5.2

Realeased 2022-09-12


## 0.5.1

Realeased 2022-09-09
Expand Down
2 changes: 1 addition & 1 deletion crates/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "moc-wasm"
version = "0.5.1"
version = "0.5.2"
authors = ["F.-X. Pineau <[email protected]>"]
description = """
WASM library to create and manipulate HEALPix
Expand Down

0 comments on commit 4a00dec

Please sign in to comment.