Skip to content

Commit

Permalink
Merge pull request #103 from quantumblacklabs/release_0_9_2
Browse files Browse the repository at this point in the history
Release 0.9.2
  • Loading branch information
qbphilip authored Mar 11, 2021
2 parents 3a6844a + 20498ad commit b64dab0
Show file tree
Hide file tree
Showing 16 changed files with 585 additions and 415 deletions.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Upcoming release

# Release 0.9.2
* Remove Boston housing dataset from "sklearn tutorial", see #91 for more information.
* Update pylint version to 2.7
* Improve speed and non-stochasticity of tests

# Release 0.9.1
* Fixed bug where the sklearn tutorial documentation wasn't rendering.
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.9.1"
__version__ = "0.9.2"

__all__ = ["structure", "discretiser", "evaluation", "inference", "network", "plots"]
8 changes: 3 additions & 5 deletions causalnex/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@ def do_intervention(
ValueError: if performing intervention would create an isolated node.
"""
if not any(
[
node in inspect.getargs(f.__code__)[0][1:]
for _, f in self._node_functions.items()
]
node in inspect.getargs(f.__code__)[0][1:]
for _, f in self._node_functions.items()
):
raise ValueError(
"Do calculus cannot be applied because it would result in an isolate"
Expand Down Expand Up @@ -289,7 +287,7 @@ def template() -> float:
return self._cpds[arg_spec.args[0]][ # target name
arg_spec.locals[arg_spec.args[0]]
][ # target state
tuple([(arg, arg_spec.locals[arg]) for arg in arg_spec.args[1:]])
tuple((arg, arg_spec.locals[arg]) for arg in arg_spec.args[1:])
] # conditions

code = template.__code__
Expand Down
4 changes: 2 additions & 2 deletions causalnex/network/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def _predict_from_complete_data(
transformed_data[
"{node}_prediction".format(node=node)
] = transformed_data.apply(
lambda row: cpd[tuple([row[parent] for parent in parents])].idxmax()
lambda row: cpd[tuple(row[parent] for parent in parents)].idxmax()
if parents
else cpd[""].idxmax(),
axis=1,
Expand Down Expand Up @@ -528,7 +528,7 @@ def _predict_probability_from_complete_data(
def lookup_probability(row, s):
"""Retrieve probability from CPD"""
if parents:
return cpd[tuple([row[parent] for parent in parents])].loc[s]
return cpd[tuple(row[parent] for parent in parents)].loc[s]
return cpd.at[s, ""]

for state in self.node_states[node]:
Expand Down
1 change: 0 additions & 1 deletion causalnex/structure/pytorch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@


# Problem in pytorch 1.6 (_forward_unimplemented), fixed in next release:
# pylint: disable=abstract-method
class NotearsMLP(nn.Module, BaseEstimator):
"""
Class for NOTEARS MLP (Multi-layer Perceptron) model.
Expand Down
1 change: 0 additions & 1 deletion causalnex/structure/pytorch/nonlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@


# Problem in pytorch 1.6 (_forward_unimplemented), fixed in next release:
# pylint: disable=abstract-method
class LocallyConnected(nn.Module):
"""
Local linear layer, i.e. Conv1dLocal() with filter size 1.
Expand Down
Loading

0 comments on commit b64dab0

Please sign in to comment.