use crate::py::node_field::PyNodeField;
use pyo3::prelude::*;
#[cfg_attr(feature = "stub-gen", pyo3_stub_gen::derive::gen_stub_pyfunction)]
#[pyfunction]
#[pyo3(name = "set_positions")]
#[pyo3(signature = (field, components=None))]
pub fn set(field: PyRef<PyNodeField>, components: Option<Vec<String>>) -> PyResult<()> {
crate::ops::coords::set(&field.inner, components)?;
Ok(())
}
#[cfg_attr(feature = "stub-gen", pyo3_stub_gen::derive::gen_stub_pyfunction)]
#[pyfunction]
#[pyo3(signature = (field, components=None))]
pub fn displace(field: PyRef<PyNodeField>, components: Option<Vec<String>>) -> PyResult<()> {
crate::ops::coords::displace(&field.inner, components)?;
Ok(())
}
#[cfg_attr(feature = "stub-gen", pyo3_stub_gen::derive::gen_stub_pyfunction)]
#[pyfunction]
#[pyo3(signature = (field, reference, target, components=None))]
pub fn displace_from(
field: PyRef<PyNodeField>,
reference: usize,
target: usize,
components: Option<Vec<String>>,
) -> PyResult<()> {
crate::ops::coords::displace_from(&field.inner, reference, target, components)?;
Ok(())
}