Skip to content

Commit f3c0f29

Browse files
committed
remove ndims deprecation and extraneous code
1 parent a715ec7 commit f3c0f29

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

pymc_extras/distributions/discrete.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import warnings
16-
1715
import numpy as np
1816
import pymc as pm
1917

@@ -23,8 +21,6 @@
2321
from pytensor import tensor as pt
2422
from pytensor.tensor.random.op import RandomVariable
2523

26-
warnings.filterwarnings("ignore", category=FutureWarning, message="ndims_params is deprecated")
27-
2824

2925
def log1mexp(x):
3026
cond = x < np.log(0.5)
@@ -409,18 +405,12 @@ def dist(cls, mu1, mu2, **kwargs):
409405
class GrassiaIIGeometricRV(RandomVariable):
410406
name = "g2g"
411407
signature = "(),(),()->()"
412-
ndims_params = [0, 0, 0] # deprecated in PyTensor 2.31.7, but still required for RandomVariable
413408

414409
dtype = "int64"
415410
_print_name = ("GrassiaIIGeometric", "\\operatorname{GrassiaIIGeometric}")
416411

417412
@classmethod
418413
def rng_fn(cls, rng, r, alpha, time_covariate_vector, size):
419-
# Cast inputs as numpy arrays
420-
r = np.asarray(r, dtype=np.float64)
421-
alpha = np.asarray(alpha, dtype=np.float64)
422-
time_covariate_vector = np.asarray(time_covariate_vector, dtype=np.float64)
423-
424414
# Determine output size
425415
if size is None:
426416
size = np.broadcast_shapes(r.shape, alpha.shape, time_covariate_vector.shape)
@@ -525,8 +515,6 @@ def logp(value, r, alpha, time_covariate_vector=None):
525515
time_covariate_vector = pt.as_tensor_variable(time_covariate_vector)
526516

527517
def C_t(t):
528-
if t == 0:
529-
return pt.constant(0.0)
530518
if time_covariate_vector.ndim == 0:
531519
return t
532520
else:

tests/distributions/test_discrete.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import warnings
1514

1615
import numpy as np
1716
import pymc as pm
@@ -20,8 +19,6 @@
2019
import pytest
2120
import scipy.stats
2221

23-
warnings.filterwarnings("ignore", category=FutureWarning, message="ndims_params is deprecated")
24-
2522
from pymc.testing import (
2623
BaseTestDistributionRandom,
2724
Domain,

0 commit comments

Comments
 (0)