Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous fixes #939

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/generate_lkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,17 @@ def simple_constraint_map(all_combos: frozenset[Combo]) -> tuple[dict[frozenset[
if i > 0:
less_than = frozenset({combo for combo in all_combos if combo.py_version < py_version})
constraint_map[less_than] = f"; python_version<'{py_version}'"
# We want to use >= next version instead of > this version
# because otherwise we have pairs like
# somelib==1.2, python_version<'3.9'
# somelib==1.3, python_version>'3.8'
# which is correct but looks more confusing than
# somelib==1.2, python_version<'3.9'
# somelib==1.3, python_version>='3.9'
if i < len(all_py_versions)-2:
greater_than = frozenset({combo for combo in all_combos if combo.py_version > py_version})
constraint_map[greater_than] = f"; python_version>'{py_version}'"
next_version = sorted(all_py_versions)[i+1]
greater_than = frozenset({combo for combo in all_combos if combo.py_version >= next_version})
constraint_map[greater_than] = f"; python_version>='{next_version}'"

# if every combination is present, we don't need to add any constraint
constraint_map[all_combos] = ""
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ jobs:
- name: Install graphviz
run: sudo apt-get -yq install graphviz
- name: Build documentation
run: pip install "sphinx~=4.4.0" "sphinx_rtd_theme~=1.0.0" && python setup.py build_sphinx -W
run: pip install "sphinx~=7.0" "sphinx_rtd_theme~=2.0.0" && sphinx-build ./doc/ ./build/sphinx/html/ -W
- name: Upload docs as artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: build/sphinx/html/
- name: Run doctests
run: python setup.py build_sphinx -b doctest
run: sphinx-build ./doc/ ./build/sphinx/doctest/ -b doctest
if : ${{ inputs.run_doctests }}

publish-docs:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,7 @@ BibTex:

This project welcomes contributions and suggestions. We use the [DCO bot](https://github.com/apps/dco) to enforce a [Developer Certificate of Origin](https://developercertificate.org/) which requires users to sign-off on their commits. This is a simple way to certify that you wrote or otherwise have the right to submit the code you are contributing to the project. Git provides a `-s` command line option to include this automatically when you commit via `git commit`.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
If you forget to sign one of your commits, the DCO bot will provide specific instructions along with the failed check; alternatively you can use `git commit --amend -s` to add the sign-off to your last commit if you forgot it or `git rebase --signoff` to sign all of the commits in the branch, after which you can force push the changes to your branch with `git push --force-with-lease`.

This project has adopted the [PyWhy Code of Conduct](https://github.com/py-why/governance/blob/main/CODE-OF-CONDUCT.md).

Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'sklearn': ('https://scikit-learn.org/stable/', None),
'sklearn': ('https://scikit-learn.org/1.5/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'shap': ('https://shap.readthedocs.io/en/stable/', None),
'dowhy': ('https://www.pywhy.org/dowhy/v0.8/', None),
'dowhy': ('https://www.pywhy.org/dowhy/main/', None),
'statsmodels': ('https://www.statsmodels.org/stable/', None)}


Expand Down
6 changes: 6 additions & 0 deletions econml/grf/_base_grftree.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,9 @@ def feature_importances(self, max_depth=4, depth_decay_exponent=2.0):
@property
def feature_importances_(self):
return self.feature_importances()


# HACK: sklearn 1.3 enforces that the input to plot_tree is a DecisionTreeClassifier or DecisionTreeRegressor
# This is a hack to get around that restriction by declaring that GRFTree inherits from DecisionTreeClassifier
from sklearn.tree import DecisionTreeClassifier # noqa: E402
DecisionTreeClassifier.register(GRFTree)
Loading
Loading