Skip to content

Commit 46beefa

Browse files
committed
style: minor style changes
1 parent 3aac0a5 commit 46beefa

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/mass_matrix/low_rank.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl LowRankMassMatrixStrategy {
328328

329329
fn rescale_points(draws: &mut Mat<f64>, grads: &mut Mat<f64>) -> Col<f64> {
330330
let (ndim, ndraws) = draws.shape();
331-
331+
332332
Col::from_fn(ndim, |col| {
333333
let draw_mean = draws.row(col).sum() / (ndraws as f64);
334334
let grad_mean = grads.row(col).sum() / (ndraws as f64);

src/sampler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,8 @@ impl<T: TraceStorage> ChainProcess<T> {
680680
.lock()
681681
.map_err(|_| anyhow::anyhow!("Could not lock trace mutex"))
682682
.context("Could not flush trace")?
683-
.as_mut().map(|v| v.flush())
683+
.as_mut()
684+
.map(|v| v.flush())
684685
.transpose()?;
685686
Ok(())
686687
}

src/state.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ impl<M: Math, P: Point<M>> State<M, P> {
104104
impl<M: Math, P: Point<M>> Drop for State<M, P> {
105105
fn drop(&mut self) {
106106
let rc = unsafe { std::mem::ManuallyDrop::take(&mut self.inner) };
107-
if (Rc::strong_count(&rc) == 1) & (Rc::weak_count(&rc) == 0)
108-
&& let Some(storage) = rc.reuser.upgrade() {
109-
storage.free_states.borrow_mut().push(rc);
110-
}
107+
if (Rc::strong_count(&rc) == 1)
108+
&& (Rc::weak_count(&rc) == 0)
109+
&& let Some(storage) = rc.reuser.upgrade()
110+
{
111+
storage.free_states.borrow_mut().push(rc);
112+
}
111113
}
112114
}
113115

src/storage/zarr/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ pub fn create_arrays<TStorage: ?Sized>(
217217
)
218218
.dimension_names(Some(dims))
219219
.build(store.clone(), &format!("{}/{}", group_path, name))?;
220-
//array.store_metadata()?;
221220
arrays.insert(name.to_string(), array);
222221
}
223222
Ok(arrays)

src/transform_adapt_strategy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<M: Math> AdaptStrategy<M> for TransformAdaptation {
197197

198198
if draw < self.final_window_size {
199199
if draw < 100 {
200-
if (draw > 0) & draw.is_multiple_of(10) {
200+
if (draw > 0) && draw.is_multiple_of(10) {
201201
hamiltonian.update_params(
202202
math,
203203
rng,
@@ -206,7 +206,7 @@ impl<M: Math> AdaptStrategy<M> for TransformAdaptation {
206206
collector.collector2.logps.iter(),
207207
)?;
208208
}
209-
} else if (draw > 0) & draw.is_multiple_of(self.options.transform_update_freq) {
209+
} else if (draw > 0) && draw.is_multiple_of(self.options.transform_update_freq) {
210210
hamiltonian.update_params(
211211
math,
212212
rng,

0 commit comments

Comments
 (0)