Skip to content

Commit

Permalink
Release PR 0.11.2 (mckinsey#240)
Browse files Browse the repository at this point in the history
* Limiting numpy version (mckinsey#217)

* adding line on yml - no effect

* adding line on yml - no effect

* changing req.txt

* changing req.txt

* changing req.txt

* adding setuptools requirement (mckinsey#218)

* adding setuptools requirement

* adding setuptools requirement

* update dictionaries to pass linting (mckinsey#230)

* Refactor/unlock numpy kl (mckinsey#235)

* unlocking numpy

* unlocking numpy

* unlocking numpy

* dependency fixes for docs and linters

* requirement fixes : numpy <1.24 for all python versions

---------

Co-authored-by: kyle_lim <kyle_lim@mckinsey.com>

* Simplifying requirements - Numpy version range (mckinsey#236)

* Remove python 3.6 and 3.7 support (mckinsey#234)

* remove python 3.6 and 3.7 support

* update documentation

* remove comment regarding ignoring a warning when running `make build-docs`

* removing ipython from test requiremnets

* Update README.md

Co-authored-by: Philip Pilgerstorfer <34248114+qbphilip@users.noreply.github.com>

---------

Co-authored-by: GabrielAz <gabriel.azevedoferreira@quantumblack.com>
Co-authored-by: Gabriel Azevedo Ferreira <57528979+GabrielAzevedoFerreiraQB@users.noreply.github.com>
Co-authored-by: Philip Pilgerstorfer <34248114+qbphilip@users.noreply.github.com>

* unlocking numpy (mckinsey#238)

Co-authored-by: Gabriel Azevedo <gabriel_azevedo_ferreira@mckinsey.com>

* Release 0.11.2 (mckinsey#239)

Co-authored-by: Gabriel Azevedo <gabriel_azevedo_ferreira@mckinsey.com>

---------

Co-authored-by: ElisabethSesterHussQB <92664441+ElisabethSesterHussQB@users.noreply.github.com>
Co-authored-by: kyle_lim <kyle_lim@mckinsey.com>
Co-authored-by: Philip Pilgerstorfer <34248114+qbphilip@users.noreply.github.com>
Co-authored-by: Gabriel Azevedo <gabriel_azevedo_ferreira@mckinsey.com>
  • Loading branch information
5 people authored Apr 3, 2023
1 parent bfd2b81 commit 14ac4fb
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 84 deletions.
39 changes: 5 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,6 @@ utils:
- run: *unit_tests
###############################################################################
jobs:
unit_tests_36:
docker: *python
environment:
PYTHON_VERSION: '3.6'
<<: *unit_test_steps

unit_tests_37:
docker: *python
environment:
PYTHON_VERSION: '3.7'
<<: *unit_test_steps

unit_tests_38:
docker: *python
Expand All @@ -146,16 +135,6 @@ jobs:
PYTHON_VERSION: '3.10'
<<: *unit_test_steps

unit_tests_windows_36:
environment:
PYTHON_VERSION: '3.6'
<<: *unit_test_steps_windows

unit_tests_windows_37:
environment:
PYTHON_VERSION: '3.7'
<<: *unit_test_steps_windows

unit_tests_windows_38:
environment:
PYTHON_VERSION: '3.8'
Expand All @@ -171,10 +150,10 @@ jobs:
PYTHON_VERSION: '3.10'
<<: *unit_test_steps_windows

linters_37:
linters_38:
docker: *python
environment:
PYTHON_VERSION: '3.7'
PYTHON_VERSION: '3.8'
steps:
- checkout
- run: *prepare_container
Expand All @@ -187,7 +166,7 @@ jobs:
docs:
docker: *python
environment:
PYTHON_VERSION: '3.7'
PYTHON_VERSION: '3.8'
steps:
- checkout
- run: *prepare_container
Expand All @@ -208,29 +187,21 @@ workflows:
version: 2
regular:
jobs:
- unit_tests_36
- unit_tests_37
- unit_tests_38
- unit_tests_39
- unit_tests_310
- linters_37
- linters_38
- docs
- unit_tests_windows_36
- unit_tests_windows_37
- unit_tests_windows_38
- unit_tests_windows_39
- unit_tests_windows_310
- all_circleci_checks_succeeded:
requires:
- unit_tests_36
- unit_tests_37
- unit_tests_38
- unit_tests_39
- unit_tests_310
- linters_37
- linters_38
- docs
- unit_tests_windows_36
- unit_tests_windows_37
- unit_tests_windows_38
- unit_tests_windows_39
- unit_tests_windows_310
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sphinx:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.6
version: 3.8
install:
- method: pip
path: .
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ make build-docs

This command will only work on Unix-like systems and requires `pandoc` to be installed.

> ❗ Running `make build-docs` in a Python 3.5 environment may sometimes yield multiple warning messages like the following: `WARNING: toctree contains reference to nonexisting document '04_user_guide/04_user_guide'`. You can simply ignore them or switch to Python 3.6+ when building documentation.
## Developing in Docker
The Docker images have all the necessary dependencies built in. To develop using the docker containers do the following

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Theme | Status |
|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Latest Release | [![PyPI version](https://badge.fury.io/py/causalnex.svg)](https://pypi.org/project/causalnex/) |
| Python Version | [![Python Version](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue.svg)](https://pypi.org/project/causalnex/) |
| Python Version | [![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue.svg)](https://pypi.org/project/causalnex/) |
| `master` Branch Build | [![CircleCI](https://circleci.com/gh/quantumblacklabs/causalnex/tree/master.svg?style=shield&circle-token=92ab70f03f3183655473dad16be641959cd31b83)](https://circleci.com/gh/quantumblacklabs/causalnex/tree/master) |
| `develop` Branch Build | [![CircleCI](https://circleci.com/gh/quantumblacklabs/causalnex/tree/develop.svg?style=shield&circle-token=92ab70f03f3183655473dad16be641959cd31b83)](https://circleci.com/gh/quantumblacklabs/causalnex/tree/develop) |
| Documentation Build | [![Documentation](https://readthedocs.org/projects/causalnex/badge/?version=latest)](https://causalnex.readthedocs.io/) |
Expand Down
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Upcoming release
* Support newer version of Numpy
* Support newer version of Scikit-learn
* Remove python 3.6, 3.7 support

# Release 0.11.1

Expand Down
2 changes: 1 addition & 1 deletion causalnex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
causalnex toolkit for causal reasoning (Bayesian Networks / Inference)
"""

__version__ = "0.11.1"
__version__ = "0.11.2"

__all__ = ["structure", "discretiser", "evaluation", "inference", "network", "plots"]
4 changes: 2 additions & 2 deletions causalnex/structure/dynotears.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ def _matrices_to_structure_model(
sm.add_nodes_from(lag_cols)
sm.add_edges_from(
[
(lag_cols[i], lag_cols[j], dict(weight=w_est[i, j]))
(lag_cols[i], lag_cols[j], {"weight": w_est[i, j]})
for i in range(w_est.shape[0])
for j in range(w_est.shape[1])
if w_est[i, j] != 0
]
)
sm.add_edges_from(
[
(lag_cols[i + w_est.shape[0]], lag_cols[j], dict(weight=a_est[i, j]))
(lag_cols[i + w_est.shape[0]], lag_cols[j], {"weight": a_est[i, j]})
for i in range(a_est.shape[0])
for j in range(a_est.shape[1])
if a_est[i, j] != 0
Expand Down
2 changes: 1 addition & 1 deletion docs/source/01_introduction/01_introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You can also check out the resources section for answers to frequently asked que
We have designed the documentation in general, and the tutorial in particular, for beginners to get started using Bayesian Networks on their projects. If you an have elementary knowledge of Python and Bayesian Networks then you may find the CausalNex learning curve more challenging. However, we have simplified the tutorial by providing all the Python functions necessary to create your first CausalNex project.

Note: There are a number of excellent online resources for learning Python, but be aware that
you should choose those that reference Python 3, as CausalNex is built for Python 3.6+.
you should choose those that reference Python 3, as the latest versions of CausalNex are built for Python 3.8+.
There are many curated lists of online resources, such as:

- [Official Python programming language website](https://www.python.org/)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api_docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Welcome to CausalNex's API docs and tutorials!
:target: https://github.com/quantumblacklabs/causalnex
:alt: Test coverage

.. image:: https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.8%20%7C%203.10-blue.svg
.. image:: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.8%20%7C%203.10-blue.svg
:target: https://pypi.org/project/causalnex/
:alt: Python version 3.6, 3.7, 3.8, 3.9, 3.10
:alt: Python version 3.8, 3.9, 3.10

.. image:: https://badge.fury.io/py/causalnex.svg
:target: https://pypi.org/project/causalnex/
Expand Down
17 changes: 7 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
ipython>=8.10.0 # Required by Snyk
networkx~=2.5
numpy<1.24; python_version >= '3.10'
numpy>=1.14.2, <1.22; python_version < '3.10'
numpy>=1.14.2, <1.24
pandas>=1.0, <2.0
pathos>=0.2.7, <0.3.0
pgmpy>=0.1.14, <0.1.20
scikit-learn>=0.22.0, <0.25.0, !=0.22.2.post1, !=0.24.1; python_version < '3.9'
scikit-learn>=0.24.0, <0.25.0, !=0.24.1; python_version == '3.9'
scikit-learn>=0.22.0, !=0.22.2.post1, !=0.24.1; python_version < '3.9'
scikit-learn>=0.24.0, !=0.24.1; python_version == '3.9'
scikit-learn>=0.25.0; python_version == '3.10'
scipy>=1.2.0, <1.7; python_version < '3.8'
scipy>=1.7; python_version >= '3.8'
setuptools<=60; python_version <= '3.6'
setuptools>=65.5.1; python_version > '3.6'
scipy>=1.7
setuptools>=65.5.1
torch>=1.7, <2.0
wheel>=0.37.0; python_version < '3.7'
wheel>=0.38.0; python_version >= '3.7'
wheel>=0.38.0
wrapt>=1.11.0, <1.13
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
long_description=readme,
long_description_content_type="text/markdown",
url="https://github.com/quantumblacklabs/causalnex",
python_requires=">=3.6, <3.11",
python_requires=">=3.8, <3.11",
author="QuantumBlack Labs",
author_email="causalnex@quantumblack.com",
packages=find_packages(exclude=["docs*", "tests*", "tools*"]),
Expand All @@ -78,8 +78,6 @@
keywords="Causal Reasoning, Bayesian Network, Inference, Structure Learning, Do-Calculus",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
1 change: 0 additions & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Cython>=0.29, <1.0
flake8>=3.5, <4.0
ipython>=7.0, <7.17
isort>=4.3.16, <5.0
matplotlib~=3.3
mdlp-discretization~=0.3.3
Expand Down
54 changes: 28 additions & 26 deletions tests/ebaybbn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def sprinkler_graph():
rain.parents = [cloudy]
rain.children = [wet_grass]
wet_grass.parents = [sprinkler, rain]
bbn = BBN(dict(cloudy=cloudy, sprinkler=sprinkler, rain=rain, wet_grass=wet_grass))
bbn = BBN(
{"cloudy": cloudy, "sprinkler": sprinkler, "rain": rain, "wet_grass": wet_grass}
)
return bbn


Expand Down Expand Up @@ -112,49 +114,49 @@ def f_a(a):
return 1 / 2

def f_b(a, b):
tt = dict(tt=0.5, ft=0.4, tf=0.5, ff=0.6)
tt = {"tt": 0.5, "ft": 0.4, "tf": 0.5, "ff": 0.6}
return tt[make_key(a, b)]

def f_c(a, c):
tt = dict(tt=0.7, ft=0.2, tf=0.3, ff=0.8)
tt = {"tt": 0.7, "ft": 0.2, "tf": 0.3, "ff": 0.8}
return tt[make_key(a, c)]

def f_d(b, d):
tt = dict(tt=0.9, ft=0.5, tf=0.1, ff=0.5)
tt = {"tt": 0.9, "ft": 0.5, "tf": 0.1, "ff": 0.5}
return tt[make_key(b, d)]

def f_e(c, e):
tt = dict(tt=0.3, ft=0.6, tf=0.7, ff=0.4)
tt = {"tt": 0.3, "ft": 0.6, "tf": 0.7, "ff": 0.4}
return tt[make_key(c, e)]

def f_f(d, e, f):
tt = dict(
ttt=0.01,
ttf=0.99,
tft=0.01,
tff=0.99,
ftt=0.01,
ftf=0.99,
fft=0.99,
fff=0.01,
)
tt = {
"ttt": 0.01,
"ttf": 0.99,
"tft": 0.01,
"tff": 0.99,
"ftt": 0.01,
"ftf": 0.99,
"fft": 0.99,
"fff": 0.01,
}
return tt[make_key(d, e, f)]

def f_g(c, g):
tt = dict(tt=0.8, tf=0.2, ft=0.1, ff=0.9)
tt = {"tt": 0.8, "tf": 0.2, "ft": 0.1, "ff": 0.9}
return tt[make_key(c, g)]

def f_h(e, g, h):
tt = dict(
ttt=0.05,
ttf=0.95,
tft=0.95,
tff=0.05,
ftt=0.95,
ftf=0.05,
fft=0.95,
fff=0.05,
)
tt = {
"ttt": 0.05,
"ttf": 0.95,
"tft": 0.95,
"tff": 0.05,
"ftt": 0.95,
"ftf": 0.05,
"fft": 0.95,
"fff": 0.05,
}
return tt[make_key(e, g, h)]

return [f_a, f_b, f_c, f_d, f_e, f_f, f_g, f_h]
Expand Down

0 comments on commit 14ac4fb

Please sign in to comment.