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

Block nets need text_keys and textual representation #75

Closed
jamesrkg opened this issue Sep 25, 2015 · 1 comment
Closed

Block nets need text_keys and textual representation #75

jamesrkg opened this issue Sep 25, 2015 · 1 comment
Assignees
Milestone

Comments

@jamesrkg
Copy link
Contributor

Block nets are currently done like this:

net_views.add_method(
    name='Top_Middle_Bottom',
    kwargs={
        'logic': [
            {'Top 2 Box': frange('9,10')},
            {'Middle 3 Box': frange('6-8')},
            {'Bottom 5 Box': frange('1-5')}]})

But the problem here is the lack of a conventional text object that supports multiple labels via text_key. All labels in Quantipy must provide multi-label support.

To that end we should implement a block- kwarg for defning multiple uses of the same method that are returned in a single group.

The following example shows the first of these we need to implement: block-logic.

net_views.add_method(
    name='Top_Middle_Bottom',
    kwargs={
        'block-logic': {
            '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'}}]}})

The -logic part of the block- kwarg informs how the content of the items object should be interpreted. This allows the textual representation of each item to be given in place of where 'logic' would normally appear, so that 'top2': frange('9,10') is read as 'logic': frange('9,10') with the textual representation top2.

The unpainted version of the resulting dataframe will show an index with the values 'top2', 'mid3' and 'bot5'. When painted those representations will be translated by the given text_key as per any normal data value from a single or delimited set column.

The block- kwarg needs to itself be a dict with an items object to provide space for additional instructions, such as rules and additional custom properties.

@jamesrkg jamesrkg added this to the RG-11 milestone Sep 25, 2015
@jamesrkg jamesrkg self-assigned this Sep 25, 2015
@jamesrkg jamesrkg modified the milestones: RG-12, RG-11, RG-13 Oct 9, 2015
@jamesrkg jamesrkg modified the milestones: RG-14, RG-13 Oct 24, 2015
@jamesrkg jamesrkg modified the milestones: RG-17, RG-14 Nov 6, 2015
@jamesrkg jamesrkg modified the milestones: RG-19, RG-17 Nov 18, 2015
@jamesrkg jamesrkg modified the milestones: RG-20, RG-19 Dec 4, 2015
@jamesrkg jamesrkg modified the milestones: RG-22, RG-20 Dec 11, 2015
@jamesrkg
Copy link
Contributor Author

This will be resolved by #290.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant