Skip to content

Commit

Permalink
Revert SIArray1 interfaces (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
prehner authored Oct 23, 2024
1 parent f7fa05e commit 3ed75c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions si-units/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,7 @@ struct SIArray1;

#[pymethods]
impl SIArray1 {
#[staticmethod]
#[expect(clippy::new_ret_no_self)]
fn new(value: Bound<'_, PyAny>) -> PyResult<Bound<'_, PySIObject>> {
fn __call__<'py>(&self, value: Bound<'py, PyAny>) -> PyResult<Bound<'py, PySIObject>> {
let py = value.py();
if let Ok(v) = value.extract::<SINumber>() {
let value = arr1(&[1.0]) * v.value;
Expand Down Expand Up @@ -508,7 +506,7 @@ pub fn si_units(m: &Bound<'_, PyModule>) -> PyResult<()> {

m.add_class::<PySIObject>()?;
m.add_class::<PyAngle>()?;
m.add_class::<SIArray1>()?;
m.add("SIArray1", SIArray1)?;

add_constant(m, "SECOND", 1.0, _SECOND)?;
add_constant(m, "METER", 1.0, _METER)?;
Expand Down

0 comments on commit 3ed75c3

Please sign in to comment.