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

Variable: Add sparse flag #2736

Merged
merged 4 commits into from
Nov 3, 2017
Merged

Variable: Add sparse flag #2736

merged 4 commits into from
Nov 3, 2017

Conversation

nikicc
Copy link
Contributor

@nikicc nikicc commented Nov 3, 2017

Issue

In order to properly support sparse features, this PR introduces the Variable.sparse flag, which indicates that the variable suggests to be stored in sparse format.

Description of changes
  • Add sparse flag to variables.
  • When copying variables, copy the sparse flag as well. This is far from correct, but it should do for a start.
Includes
  • Code changes
  • Tests
  • Documentation

@nikicc nikicc mentioned this pull request Nov 3, 2017
3 tasks
@nikicc nikicc added this to the 3.8 milestone Nov 3, 2017
@codecov-io
Copy link

codecov-io commented Nov 3, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@727430c). Click here to learn what that means.
The diff coverage is 92.3%.

@@            Coverage Diff            @@
##             master    #2736   +/-   ##
=========================================
  Coverage          ?   76.04%           
=========================================
  Files             ?      338           
  Lines             ?    59644           
  Branches          ?        0           
=========================================
  Hits              ?    45359           
  Misses            ?    14285           
  Partials          ?        0

@nikicc nikicc force-pushed the variable-sparse branch 3 times, most recently from e58fcc4 to 8287dfe Compare November 3, 2017 12:07
@@ -565,12 +571,13 @@ class DiscreteVariable(Variable):
_all_vars = collections.defaultdict(list)
presorted_values = []

def __init__(self, name="", values=(), ordered=False, base_value=-1, compute_value=None):
def __init__(self, name="", values=(), ordered=False, base_value=-1,
compute_value=None, *, sparse=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janezd we might want to move * after values, but not in this PR.

@astaric astaric merged commit 0feba87 into biolab:master Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants