Skip to content

Conversation

@apdavison
Copy link
Member

No description provided.

@apdavison apdavison added this to the 0.12.0 milestone Sep 29, 2022
@JuliaSprenger
Copy link
Member

Hi @apdavison These pretty representations are only used by the ipython lib or is there any way on how these are used by python itself? What is the advantage of having this verbose representation instead of the __repr__ implementation?

@apdavison
Copy link
Member Author

Yes, these are used in IPython and Jupyter notebooks. Python also has the pprint module. This PR is basically just improving the "pretty" representations for Epoch, Event and SpikeTrain; the representations for AnalogSignal, Segment, Block are already ok.

@JuliaSprenger
Copy link
Member

JuliaSprenger commented Nov 4, 2022

For me the Python pprint is not using the _repr_pretty_, but _repr_. Did you expect pprint to also use the new implementation?

@apdavison
Copy link
Member Author

I wasn't sure about pprint, but I didn't test because I was mainly concerned about IPython and Jupyter.

It would be good to refactor things in the future to have consistent behaviour between _repr_pretty_ and _repr_, but for now I just want to be sure that IPython pretty gives consistent behaviour across the Neo core classes.

@JuliaSprenger JuliaSprenger merged commit 7fc30cb into NeuralEnsemble:master Nov 4, 2022
@apdavison apdavison deleted the improved-pretty branch July 27, 2023 08:41
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.

2 participants