Skip to content

Commit

Permalink
Do we need n? (#13)
Browse files Browse the repository at this point in the history
* don't need to assign self.__n_x_nodes until __call__

* more consistent use of single element slice
  • Loading branch information
AdamOrmondroyd authored Jan 25, 2024
1 parent a32db8b commit 208bcc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions flexknot/priors.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def __init__(self, x_min, x_max, y_min, y_max, N_min, N_max):
# redefine self._x_prior
self.__used_x_prior = self._x_prior
self.__unused_x_prior = UniformPrior(x_min, x_max)
self.__n_x_nodes = int(N_max)
self._x_prior = (
lambda hypercube_x: np.concatenate(
(
Expand All @@ -88,7 +87,7 @@ def __call__(self, hypercube):
"""
prior = np.empty(hypercube.shape)
prior[[0]] = self._N_prior(hypercube[0:1])
prior[[0]] = self._N_prior(hypercube[[0]])
self.__n_x_nodes = int(prior[0])
prior[1:] = super().__call__(hypercube[1:])
return prior
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "flexknot"
version = "1.2.0"
version = "1.2.1"
description = "Flex-Knot"
authors = [{name="Adam Neil Ormondroyd", email="[email protected]"}]
readme = "README.md"
Expand Down

0 comments on commit 208bcc6

Please sign in to comment.