Skip to content

Commit

Permalink
Merge branch 'develop' into requires-io-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
enadeau committed Oct 6, 2019
2 parents 8cd7551 + a2e260a commit 03b391a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.2] - 2019-09-06
### Added
- `ProofTree.count_objects_of_length()` implements the recurrence relation
implied by the proof tree as long as the strategies used are only disjoint unions,
Expand Down
10 changes: 2 additions & 8 deletions comb_spec_searcher/proof_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,9 @@ def __eq__(self, other):

def get_function(self, min_poly=False):
if min_poly:
if (self.sympy_function is None or
isinstance(self.sympy_function, sympy.Function)):
self.sympy_function = sympy.var("F_" + str(self.label))
return sympy.var("F_" + str(self.label))
else:
if (self.sympy_function is None or
isinstance(self.sympy_function, sympy.Symbol)):
self.sympy_function = sympy.Function(
"F_" + str(self.label))(sympy.abc.x)
return self.sympy_function
return sympy.Function("F_" + str(self.label))(sympy.abc.x)

def get_equation(self, root_func=None, root_class=None,
dummy_eq=False, min_poly=False, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion comb_spec_searcher/rule_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
Use to keep track of all batch rules made by strategies. Each rule comes with
an explanantion.
"""
from collections import Iterable, defaultdict
from collections import defaultdict
from collections.abc import Iterable


class RuleDB(object):
Expand Down
6 changes: 3 additions & 3 deletions comb_spec_searcher/strategies/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
In the future, you should also declare the method needed for counting. The
types supported for a rule a -> b_1, b_2, ..., b_k are
- disjoint union: f(a) = f(b_1) + f(b_2) + ... + f(b_k)
- cartesiian product: f(a) = f(b_1) * f(b_2) * ... * f(b_k)
- cartesian product: f(a) = f(b_1) * f(b_2) * ... * f(b_k)
'''
import warnings
from collections import Iterable
from collections.abc import Iterable
from functools import partial


Expand All @@ -32,7 +32,7 @@ def __init__(self, formal_step, comb_classes, inferable, possibly_empty,
raise TypeError("Inferable should be an iterable of booleans")
if constructor not in ['disjoint', 'cartesian', 'equiv', 'other']:
raise ValueError(("Not valid constructor. Only accepts"
" disjoint or cartesian."))
" disjoint, cartesian, equiv and other."))

self.constructor = constructor
self.formal_step = formal_step
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def read(fname):

setup(
name="comb_spec_searcher",
version="0.2.1",
version="0.2.2",
author="Permuta Triangle",
author_email="christianbean@ru.is",
author_email="permutatriangle@gmail.com",
description="A library for performing combinatorial exploration.",
license="BSD-3",
keywords="enumerative combinatorics combinatorial specification counting",
Expand Down

0 comments on commit 03b391a

Please sign in to comment.