Skip to content

Commit

Permalink
remove unused error, alias complex type
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Nov 21, 2024
1 parent c82b9c5 commit feb0b74
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
1 change: 0 additions & 1 deletion src/cli/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ impl From<PeelArgsError> for HyperdriveError {
fn from(e: PeelArgsError) -> Self {
match e {

Check warning on line 174 in src/cli/error.rs

View check run for this annotation

Codecov / codecov/patch

src/cli/error.rs#L173-L174

Added lines #L173 - L174 were not covered by tests
PeelArgsError::NoOutput
| PeelArgsError::NoChannels
| PeelArgsError::ZeroPasses
| PeelArgsError::ZeroLoops
| PeelArgsError::ParseIonoTimeAverageFactor(_)
Expand Down
3 changes: 0 additions & 3 deletions src/cli/peel/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ pub(crate) enum PeelArgsError {
#[error("No calibration output was specified. There must be at least one calibration solution file.")]
NoOutput,

#[error("The data either contains no frequency channels or all channels are flagged")]
NoChannels,

#[error("The number of iono sub passes cannot be 0")]
ZeroPasses,

Expand Down
20 changes: 0 additions & 20 deletions src/hyperdrive-peel.code-workspace

This file was deleted.

7 changes: 5 additions & 2 deletions src/params/peel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,9 @@ fn subtract_thread(
Ok(())
}

// type for passing full residuals from joiner thread
type FullResidual<'a> = (Array3<Jones<f32>>, Array3<f32>, &'a Timeblock);

/// reshapes residuals for peel.
/// receives a stream of 2D residuals and weights [chan, baseline]
/// joins them into a 3D array [time, chan, baseline] whose time axis
Expand All @@ -2645,7 +2648,7 @@ fn joiner_thread<'a>(
spw: &Spw,
num_unflagged_cross_baselines: usize,
rx_residual: Receiver<(Array2<Jones<f32>>, Array2<f32>, Epoch)>,
tx_full_residual: Sender<(Array3<Jones<f32>>, Array3<f32>, &'a Timeblock)>,
tx_full_residual: Sender<FullResidual<'a>>,
error: &AtomicCell<bool>,
) {
for timeblock in iono_timeblocks {
Expand Down Expand Up @@ -2716,7 +2719,7 @@ fn peel_thread(
low_res_lambdas_m: &[f64],
apply_precession: bool,
output_vis_params: Option<&OutputVisParams>,
rx_full_residual: Receiver<(Array3<Jones<f32>>, Array3<f32>, &Timeblock)>,
rx_full_residual: Receiver<FullResidual>,
tx_write: Sender<VisTimestep>,
tx_iono_consts: Sender<Vec<IonoConsts>>,
error: &AtomicCell<bool>,
Expand Down
2 changes: 2 additions & 0 deletions src/srclist/hyperdrive/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub(crate) fn source_list_to_yaml<T: std::io::Write>(
let mut map = HashMap::with_capacity(1);
for (name, src) in sl.iter().take(num_sources) {
map.insert(name.as_str(), serde_yaml::to_value(src)?);
// TODO: linter bug
#[allow(clippy::needless_borrows_for_generic_args)]
serde_yaml::to_writer(&mut buf, &map)?;
map.clear();
}
Expand Down

0 comments on commit feb0b74

Please sign in to comment.