Skip to content

Commit

Permalink
Merge pull request #19 from eta077/main
Browse files Browse the repository at this point in the history
Prep for 0.0.4 release
  • Loading branch information
eta077 authored Jul 2, 2022
2 parents 359c2e8 + eff975a commit 98eddb0
Show file tree
Hide file tree
Showing 12 changed files with 737 additions and 174 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --all-features

clippy:
name: Clippy
Expand All @@ -55,4 +56,4 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: --all-features -- -D warnings
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Generate test result and coverage report
run: |
cargo install cargo2junit grcov;
cargo test $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml;
cargo test --all-features $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml;
zip -0 ccov.zip `find . \( -name "$PROJECT_NAME_UNDERSCORE*.gc*" \) -print`;
grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov.info;
- name: Upload test results
Expand Down
17 changes: 12 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astro-rs"
version = "0.0.3"
version = "0.0.4"
edition = "2021"
license = "MIT"
description = "Astronomy utils"
Expand All @@ -17,16 +17,23 @@ exclude = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
chrono = { version = "0.4" }
hyper = { version = "0.14", features = ["client", "http1", "tcp"] }
measurements = { version = "0.11" }
chrono = { version = "0.4", optional = true }
hyper = { version = "0.14", features = ["client", "http1", "tcp"], optional = true }
measurements = { version = "0.11", optional = true }
thiserror = { version = "1.0" }
urlencoding = { version = "2.1" }
urlencoding = { version = "2.1", optional = true }

[dev-dependencies]
criterion = { version = "0.3", features = ["html_reports"] }
image = { version = "0.24", default-features = false, features = ["jpeg"] }
tokio-test = { version = "0.4" }

[features]
coordinates = ["dep:chrono", "dep:hyper", "dep:measurements", "dep:urlencoding"]

[[bench]]
name = "fits_benchmark"
harness = false

[profile.bench]
debug = true
Binary file added assets/eagle_nebula/eagle_composite.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion benches/fits_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,17 @@ fn bench_get_header(c: &mut Criterion) {
});
}

criterion_group!(benches, bench_get_header);
fn bench_get_header_20(c: &mut Criterion) {
c.bench_function("get 20th header from fits file", |b| {
b.iter(|| {
let fits_file = black_box(File::open("assets/benchmarks/many_hdu.fits").unwrap());
let fits_file_reader = BufReader::new(fits_file);

let mut hdu_list = HduList::new(fits_file_reader);
hdu_list.get_by_index(20).unwrap().header.clone()
})
});
}

criterion_group!(benches, bench_get_header, bench_get_header_20);
criterion_main!(benches);
Loading

0 comments on commit 98eddb0

Please sign in to comment.