Skip to content

Commit

Permalink
Move adstock and saturation method imports to mmm.__all__ (pymc-labs#908
Browse files Browse the repository at this point in the history
)

* Resolves pymc-labs#892: Move adstock and saturation method imports to mmm.__all__

* fix: patch uml GHA

* Update .github/workflows/uml.yml

* Update .github/workflows/uml.yml

* Add permissions: write-all to .github/workflows/uml.yml

---------

Co-authored-by: Will Dean <[email protected]>
  • Loading branch information
PabloRoque and wd60622 authored Aug 5, 2024
1 parent 41dd8a3 commit 39f2336
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/uml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
paths:
- "pymc_marketing/**"

permissions: write-all

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -39,6 +41,9 @@ jobs:
if git diff --staged --exit-code; then
echo "No changes to commit"
else
echo "Committing the changes"
git commit -m "Update UML Diagrams"
git push
git push origin HEAD:${GITHUB_HEAD_REF}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ dependencies:
- pandas
- streamlit>=1.25.0
- pip
- pydantic
- preliz
# NOTE: Keep minimum pymc version in sync with ci.yml `OLDEST_PYMC_VERSION`
- pymc>=5.12.0,<5.16.0
- scikit-learn>=1.1.1
Expand Down Expand Up @@ -41,3 +43,4 @@ dependencies:
- lifetimes==0.11.3
- pytest==7.0.1
- pytest-cov==3.0.0
- pytest-mock
8 changes: 8 additions & 0 deletions pymc_marketing/mmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
WeibullAdstock,
WeibullCDFAdstock,
WeibullPDFAdstock,
adstock_from_dict,
register_adstock_transformation,
)
from pymc_marketing.mmm.components.saturation import (
HillSaturation,
Expand All @@ -30,6 +32,8 @@
SaturationTransformation,
TanhSaturation,
TanhSaturationBaselined,
register_saturation_transformation,
saturation_from_dict,
)
from pymc_marketing.mmm.delayed_saturated_mmm import MMM, DelayedSaturatedMMM
from pymc_marketing.mmm.fourier import MonthlyFourier, YearlyFourier
Expand All @@ -56,9 +60,13 @@
"SaturationTransformation",
"TanhSaturation",
"TanhSaturationBaselined",
"saturation_from_dict",
"register_saturation_transformation",
"WeibullAdstock",
"WeibullCDFAdstock",
"WeibullPDFAdstock",
"adstock_from_dict",
"register_adstock_transformation",
"YearlyFourier",
"base",
"delayed_saturated_mmm",
Expand Down
8 changes: 5 additions & 3 deletions tests/mmm/components/test_adstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@
import xarray as xr
from pydantic import ValidationError

from pymc_marketing.mmm.components.adstock import (
ADSTOCK_TRANSFORMATIONS,
from pymc_marketing.mmm import (
AdstockTransformation,
DelayedAdstock,
GeometricAdstock,
WeibullAdstock,
WeibullCDFAdstock,
WeibullPDFAdstock,
_get_adstock_function,
adstock_from_dict,
register_adstock_transformation,
)
from pymc_marketing.mmm.components.adstock import (
ADSTOCK_TRANSFORMATIONS,
_get_adstock_function,
)
from pymc_marketing.mmm.transformers import ConvMode
from pymc_marketing.prior import Prior

Expand Down
4 changes: 2 additions & 2 deletions tests/mmm/components/test_saturation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
import xarray as xr
from pydantic import ValidationError

from pymc_marketing.mmm.components.saturation import (
from pymc_marketing.mmm import (
HillSaturation,
InverseScaledLogisticSaturation,
LogisticSaturation,
MichaelisMentenSaturation,
RootSaturation,
TanhSaturation,
TanhSaturationBaselined,
_get_saturation_function,
saturation_from_dict,
)
from pymc_marketing.mmm.components.saturation import _get_saturation_function
from pymc_marketing.prior import Prior


Expand Down

0 comments on commit 39f2336

Please sign in to comment.