diff --git a/pyproject.toml b/pyproject.toml index 055d0a1..dedf28a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "scgenerator" -version = "0.3.15" +version = "0.3.16" description = "Simulate nonlinear pulse propagation in optical fibers" readme = "README.md" authors = [{ name = "Benoit Sierro", email = "benoit.sierro@iap.unibe.ch" }] diff --git a/src/scgenerator/spectra.py b/src/scgenerator/spectra.py index df8f417..88570ae 100644 --- a/src/scgenerator/spectra.py +++ b/src/scgenerator/spectra.py @@ -253,7 +253,7 @@ class Propagation(Generic[ParamsOrNone]): def _warn_negative_index(self, index: int | None): if (index is not None and index >= 0) or self.parameters is None: return - if self._current_index < len(self.z_positions): + if self._current_index < self.parameters.z_num: warnings.warn(f"attempting to access index {index} on an incomplete propagation obj") def load_all(self) -> Spectrum: