Skip to content

scaling in coreneuron#32

Merged
cattabiani merged 3 commits into
masterfrom
katta/scaling
Jul 21, 2025
Merged

scaling in coreneuron#32
cattabiani merged 3 commits into
masterfrom
katta/scaling

Conversation

@cattabiani
Copy link
Copy Markdown
Member

Scaling was never a factor in coreneuron.

My pr aims also to add scaling to coreneuron.

Since the parameter is necessary now, we need to produce reports that are compatible.

This PR is retro-compatible with previous versions of neuron-coreneuron since scaling is added at the end

@cattabiani cattabiani self-assigned this Jul 21, 2025
@cattabiani cattabiani requested a review from JCGoran July 21, 2025 11:06
Comment thread commonutils.py Outdated
def write_report_config(output_file, report_name, target_name, report_type, report_variable,
unit, report_format, target_type, dt, start_time, end_time, gids,
buffer_size=8):
buffer_size=8, scaling="Area"):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Q: what are the possible/allowed values of the scaling argument (and possibly stupid Q, what is it referring to)? Referencing either the docs or using typing.Literal would be of great help.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the scaling is mentioned here:

https://sonata-extension.readthedocs.io/en/latest/sonata_simulation.html#reports

atm it can be none or area.

I am not familiar with typing.Literal. May you be more specific of what you want to do? Create an python enum? Where should I put it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

May you be more specific of what you want to do?

Just to add it as a type hint, i.e. scaling=Literal[None, "Area"] so the reader knows what are the possible inputs. A docstring (mentioning the the link you provided) works too.

Also, is the name case-sensitive? I see the docs have the lowercase version:

“area” (default) converts density to area values.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@cattabiani cattabiani requested a review from JCGoran July 21, 2025 13:59
Copy link
Copy Markdown

@JCGoran JCGoran left a comment

Choose a reason for hiding this comment

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

LGTM!

@cattabiani cattabiani merged commit 78b996a into master Jul 21, 2025
2 checks passed
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