Skip to content

Commit

Permalink
Merge subcrates into a single library crate.
Browse files Browse the repository at this point in the history
This commit unfortunately doesn't appear to speed up the time it takes
to compile before testing. Using `--lib` with `cargo test`, however,
does allow *most* tests to be compiled faster; a few integration tests
won't be run though.

Don't use re-exported dependencies. This means there will be a bit more
bookkeeping down the line to ensure that e.g. the same version of Marlu
is used across dependencies, but I prefer to have all dependencies made
explicit as well as available normally in the code.

Use "lto = "thin"". This makes performance slightly better and decreases
the size of the binary.

Make many types private (i.e. not public). In theory this allows for
more optimisation opportunities, but more importantly more easily
reveals what code isn't being used.

Restructure CLI arguments and tests. Calibration arguments are now much
more similar to other CLI args. True cargo integration tests require the
hyperdrive binary.

Fix some clippy lints (e.g. the `parse_from` trait method used on a
clap-enabled struct was often passed a &[], when [] was enough).

Fix some error variants not being used (either use them as intended or
delete them).

Replace `cexp` with `Complex::cis` and remove other unused math
functions. Depend on num-complex 0.4.1 because that's the version that
introduced `Complex::cis`.
  • Loading branch information
cjordan committed Oct 18, 2022
1 parent 89d91f1 commit dd5cd20
Show file tree
Hide file tree
Showing 178 changed files with 3,487 additions and 9,377 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
name: Generate Coverage report

# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

# Do this on every push, but don't double up on tags
on:
push:
tags-ignore:
- '**'
pull_request:
branches:
- '**'
- '**'

env:
CARGO_TERM_COLOR: always
Expand All @@ -21,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -53,22 +50,20 @@ jobs:
override: true
components: llvm-tools-preview

- name: install cargo-llvm-cov
run: cargo install cargo-llvm-cov
# https://lib.rs/crates/cargo-llvm-cov#readme-continuous-integration
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Get the beam HDF5 file
run: curl http://ws.mwatelescope.org/static/mwa_full_embedded_element_pattern.h5 -o mwa_full_embedded_element_pattern.h5

- name: Generate test lcov coverage into coverage/ dir
run: |
export MWA_BEAM_FILE=$(realpath mwa_full_embedded_element_pattern.h5)
mkdir -p coverage
cargo llvm-cov --all-targets --workspace --exclude mwa_hyperdrive_cuda --no-default-features --locked --lcov --output-path coverage/coverage.lcov
# this uses the result of the previous run to generate a text summary
cargo llvm-cov --no-run
cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload reports to codecov.io
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
1 change: 0 additions & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
curl https://raw.githubusercontent.com/HDFGroup/hdf5/develop/COPYING -o COPYING-hdf5
curl https://raw.githubusercontent.com/liberfa/erfa/master/LICENSE -o LICENSE-erfa
curl https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/License.txt -o LICENSE-cfitsio
cp cuda/LICENSE-NVIDIA .
cp .github/workflows/releases-readme.md README.md
cargo build --release --locked --no-default-features --features=hdf5-static,erfa-static,cfitsio-static
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,10 @@ jobs:

# Can't test with CUDA, no GPUs available in CI
- name: Run tests
run: |
cargo test
cd common && cargo test --locked && cd ..
cd beam && cargo test --locked && cd ..
# cd cuda && cargo test --locked && cd ..
cd srclist && cargo test --locked && cd ..
run: cargo test --locked

- name: Run ignored tests
run: |
cargo test -- --ignored
cd common && cargo test --locked -- --ignored && cd ..
cd beam && cargo test --locked -- --ignored && cd ..
# cd cuda && cargo test --locked -- --ignored && cd ..
cd srclist && cargo test --locked -- --ignored && cd ..
run: cargo test --locked -- --ignored

- name: Minimum-specified Rust version works
run: |
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.1] - Unreleased
### Changed
- Use "lto = "thin"". This makes performance slightly better and decreases the
size of the binary.
- Internal crates have been "folded" in with the main code. This should
hopefully make editing the code a bit simpler.
147 changes: 64 additions & 83 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dd5cd20

Please sign in to comment.