Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
juanitorduz committed Aug 20, 2024
1 parent 60ddf3e commit ce7dda6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions pymc_marketing/clv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""CLV models and utilities."""

from pymc_marketing.clv.models import (
BetaGeoModel,
GammaGammaModel,
Expand Down
2 changes: 2 additions & 0 deletions pymc_marketing/clv/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Distributions for the CLV module."""

import numpy as np
import pymc as pm
import pytensor.tensor as pt
Expand Down
2 changes: 2 additions & 0 deletions pymc_marketing/clv/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Plotting functions for the CLV module."""

from collections.abc import Sequence

import matplotlib.pyplot as plt
Expand Down
2 changes: 2 additions & 0 deletions pymc_marketing/clv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for the CLV module."""

import warnings
from datetime import date, datetime

Expand Down
5 changes: 5 additions & 0 deletions pymc_marketing/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def dims(self, dims) -> None:
self._unique_dims()

def __getitem__(self, key: str) -> Prior | Any:
"""Return the parameter of the prior."""
return self.parameters[key]

def _checks(self) -> None:
Expand Down Expand Up @@ -395,6 +396,7 @@ def _param_dims_work(self) -> None:
)

def __str__(self) -> str:
"""Return a string representation of the prior."""
param_str = ", ".join(
[f"{param}={value}" for param, value in self.parameters.items()]
)
Expand All @@ -406,6 +408,7 @@ def __str__(self) -> str:
return f'Prior("{self.distribution}"{param_str}{dim_str}{centered_str}{transform_str})'

def __repr__(self) -> str:
"""Return a string representation of the prior."""
return f"{self}"

def _create_parameter(self, param, value, name):
Expand Down Expand Up @@ -726,6 +729,7 @@ def constrain(self, lower: float, upper: float, **kwargs) -> Prior:
)

def __eq__(self, other) -> bool:
"""Check if two priors are equal."""
if not isinstance(other, Prior):
return False

Expand Down Expand Up @@ -789,6 +793,7 @@ def sample_prior(
return pm.sample_prior_predictive(**sample_prior_predictive_kwargs).prior

def __deepcopy__(self, memo) -> Prior:
"""Return a deep copy of the prior."""
if id(self) in memo:
return memo[id(self)]

Expand Down
2 changes: 2 additions & 0 deletions pymc_marketing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utility functions for PyMC Marketing."""

import warnings
from pathlib import Path

Expand Down
13 changes: 0 additions & 13 deletions pymc_marketing/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@
# limitations under the License.
"""Version of the package."""

# Copyright 2024 The PyMC Labs Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os

here = os.path.dirname(os.path.realpath(__file__))
Expand Down

0 comments on commit ce7dda6

Please sign in to comment.