Quantipy / quantipy

Python for people data
MIT License
66 stars 14 forks source link

Expanded has_any logic #86

Closed jamesrkg closed 8 years ago

jamesrkg commented 9 years ago

We need a way to generate a has_any() logical net that also includes the values contributing to that net underneath it.

So, instead of:

1
2
3
4
net-A
net-B

The option to create:

net-A
1
2
net-B
3
4

Initial thoughts about this are to add an expand kwarg.

net_views.add_method(
    name='Likely any(4,5,6)',
    kwargs={
        'text': {'en-GB': 'Net likely'},
        'logic': [4, 5, 6],
        'expand': True
    }
)

But this would also have to be implemented for block-logic (here I am using the new style proposed in #75):

net_views.add_method(
    name='Top_Middle_Bottom',
    kwargs={
        'block-logic': {
            'expand': True,
            'items': [
                {'top2': frange('9,10'), 'text': {'main': 'Top 2 Box'}},
                {'mid3': frange('6-8'), 'text': {'main': 'Middle 3 Box'}},
                {'bot5': frange('1-5'), 'text': {'main': 'Bottom 5 Box'}},
                {'others': frange('11-12'), 'text': {'main': 'Others'}, 'expand': False}
            ]
        }
    }
)
jamesrkg commented 8 years ago

This will be resolved by #290.