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

New GIDCollection print #13

Merged
merged 7 commits into from
May 3, 2019
Merged

Conversation

stinebuu
Copy link

Change the way we print GIDCollections, see #8 for details.

Printing a primitive GIDCollection without metadata will look like:

GIDCollection(metadata=None model=iaf_psc_alpha, size=5, (1..5))

Printing a layer will look like:

GIDCollection(metadata=spatial model=iaf_psc_alpha, size=25, (54..78))

Printing a sliced composite with more than 7 parts will look like:

GIDCollection(metadata=None, size=17:
              model=iaf_psc_alpha, size=3, (1..{2}..5);
              model=iaf_psc_delta, size=1, (7);
              model=iaf_psc_exp, size=1, (9);
              ..
              model=spike_detector, size=1, (19);
              model=iaf_psc_alpha, size=2, (21, 23);
              model=iaf_cond_alpha, size=5, (45..{2}..53))

@heplesser
Copy link
Member

Nice, but I am wondering a bit about the stepping notation

 model=iaf_psc_alpha, size=3, (1..{2}..5);

Do we need the curly braces? And maybe we could make the notation even more consistent like this:

 model=iaf_psc_alpha, size=3, gids=1..2..5;
 model=iaf_psc_alpha, size=3, gids=6..8;
 model=iaf_psc_alpha, size=1, gids=9;

and similarly for non-composite.

@hakonsbm
Copy link

@heplesser My idea when adding the curly braces to the stepping notation was to separate number of steps from GIDs, because I thought writing (1..2..5) could look like it means

(GID=1 [some GIDs] GID=2 [some GIDs] GID=5)

@heplesser
Copy link
Member

Maybe we should have a little poll on NEST User? I also thought about the Python notation 1:5:2, but that is confusing, since in real Python that is on 1 and 3, 5 is excluded.

@stinebuu
Copy link
Author

@heplesser I like the notation of gids=6..8 for consistency. Concerning the stepping, would

model=iaf_psc_alpha, size=3, gids=1..5, step=2;

be an option?

@heplesser
Copy link
Member

I am not totally happy with the notation, since it puts step at the same level as gids. How about

model=iaf_psc_alpha, size=3, gids=1..5 [step 2];

Should we have a discussion and vote on Monday?

@stinebuu
Copy link
Author

stinebuu commented Nov 5, 2018

@heplesser Discussion and vote sounds good!

@stinebuu
Copy link
Author

stinebuu commented Nov 7, 2018

From NEST VC: Use first, last and step:
model=iaf_psc_alpha, size=3, first=1, last=5, step=2;

Also, the first size variable from the sliced composite above makes it look like there are 17 parts of the composite, not 17 GIDs.

@stinebuu
Copy link
Author

stinebuu commented Nov 8, 2018

With 97e33f0 we will have the following

Printing a primitive GIDCollection without metadata:

GIDCollection(metadata=None, model=iaf_psc_alpha, size=5, first=1, last=5)

Printing a composite GIDCollection without any slicing:

GIDCollection(metadata=None,
              model=iaf_psc_alpha, size=5, first=1, last=5;
              model=iaf_psc_delta, size=3, first=6, last=8;
              model=iaf_psc_exp, size=1, first=9;
              model=iaf_cond_alpha, size=7, first=10, last=16;
              model=poisson_generator, size=1, first=17;
              model=spike_detector, size=3, first=18, last=20)

Printing a sliced composite with more than 7 parts:

GIDCollection(metadata=None,
              model=iaf_psc_alpha, size=3, first=1, last=5, step=2;
              model=iaf_psc_delta, size=1, first=7, last=7;
              model=iaf_psc_exp, size=1, first=9, last=9;
              ..
              model=spike_detector, size=1, first=19, last=19;
              model=iaf_psc_alpha, size=2, first=21, last=23, step=2;
              model=iaf_cond_alpha, size=5, first=45, last=53, step=2)

Printing a layer:

GIDCollection(metadata=spatial, model=iaf_psc_alpha, size=25, first=54, last=78)

@heplesser @hakonsbm what do you think?

stinebuu pushed a commit that referenced this pull request Feb 27, 2019
adding pynest apis and topology
@stinebuu
Copy link
Author

@heplesser @hakonsbm as discussed, I have now removed the partitioning when a composite have more than 7 parts.

@heplesser
Copy link
Member

@stinebuu So what happens now if you print a GC with more than seven parts?

@stinebuu
Copy link
Author

@heplesser You are shown all the parts of the GIDCollection, like this, where we have a composite gc which is sliced and consists of 8 primitives:

GIDCollection(metadata=None,
              model=iaf_psc_alpha, size=3, first=1, last=5, step=2;
              model=iaf_psc_delta, size=1, first=7, last=7;
              model=iaf_psc_exp, size=1, first=9, last=9;
              model=iaf_cond_alpha, size=3, first=11, last=15, step=2;
              model=poisson_generator, size=1, first=17, last=17;
              model=spike_detector, size=1, first=19, last=19;
              model=iaf_psc_alpha, size=2, first=21, last=23, step=2;
              model=iaf_cond_alpha, size=5, first=45, last=53, step=2)

@heplesser
Copy link
Member

heplesser commented Apr 16, 2019 via email

@hakonsbm hakonsbm merged commit 3e58d4e into compneuronmbu:nest-3 May 3, 2019
@stinebuu stinebuu deleted the GIDColl-print branch August 20, 2019 14:50
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