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

Fix reference doc issues #1534

Merged
merged 3 commits into from
May 31, 2024
Merged

Fix reference doc issues #1534

merged 3 commits into from
May 31, 2024

Conversation

mstimberg
Copy link
Member

When fixing warnings about unused variables and similar issues quite a while back (commit 0344b00), I inadvertently broke a few features of the reference documentation – partly because some of the warnings were somewhat misleading (e.g. some function call return values weren't used, but the functions updated global variables). This should fix the issue dicussed in #1532.

I've built the updated documentation here, from a quick glance it seems to be working correctly: https://brian2.readthedocs.io/en/fix_doc_reference_issues/

Closes #1532

Copy link
Member

@thesamovar thesamovar left a comment

Choose a reason for hiding this comment

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

This all looks pretty reasonable to me!

@mstimberg
Copy link
Member Author

With hindsight, I'm really embarrassed about having changed doc[start : len(doc) - stop] into doc[start:-stop]. Like, oh, these dummies don't know that you can simply use negative indices for that in Python. But well, this works well unless stop is 0 😬

@thesamovar
Copy link
Member

I've shot myself in the foot with that one too. Increasingly think that notation might have been a mistake for Python. Some language allows you to write end-1 or something like that, which is maybe better.

@mstimberg
Copy link
Member Author

Actually in this specific case, making -0 different from 0 would have worked, too :-P

@mstimberg mstimberg merged commit 9fe49ba into master May 31, 2024
62 checks passed
@mstimberg mstimberg deleted the fix_doc_reference_issues branch May 31, 2024 14:31
@thesamovar
Copy link
Member

Hah! Maths has things to say about that though. ;-)

Although I think in floating point representations -0.0 is different from +0.0.

@mstimberg
Copy link
Member Author

Although I think in floating point representations -0.0 is different from +0.0.

It is indeed! and things like $\frac{1}{-\infty} = -0$ are even required by the IEEE standard, I think. A can of worms 😆

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.

Issue: Tutorial Part 1 documentation for StateMonitor
2 participants