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

Name of h is misleading #2699

Open
ramcdougal opened this issue Feb 1, 2024 · 1 comment
Open

Name of h is misleading #2699

ramcdougal opened this issue Feb 1, 2024 · 1 comment
Labels
improvement Improvement over existing implementation python
Milestone

Comments

@ramcdougal
Copy link
Member

@Helveg observed that

>>> from neuron import h
>>> h
<TopLevelHocInterpreter>

While h can be used to interpret Hoc, that is not its primary function. It's an interface to the NEURON stack machine at a level below the Hoc interpreter. (I tell people that h stands for NEURON, just like d stands for integer in C string formatting.)

Given that NEURON 9.0 is coming up, maybe now is a good time to change how it displays. What about:

>>> h
<NEURON>

or

>>> h
<NEURONStackMachine>

I'm not picky, but there's no reason for anyone to see "Hoc" here.

Unfortunately, I think we are stuck with

>>> type(h)
<class 'hoc.HocObject'>

because people may be subclassing from that, but I don't see anyone making assumptions that depend on repr(h)

@ramcdougal ramcdougal added python improvement Improvement over existing implementation labels Feb 1, 2024
@ramcdougal ramcdougal added this to the Release v9.0 milestone Feb 1, 2024
@nrnhines
Copy link
Member

nrnhines commented Feb 5, 2024

I don't have an objection (or at least any objection would be very weak) to

>>> h
<NEURON>

In favor, h provides access to "all" of NEURON. The weak objection I suppose is the relation of that to the already existing
top level module name import neuron and the subsidiary neuron.nrn vs neuron.hoc modules. I've always tried to distinguish between general interpreter features and neuroscience specific features. That dates back to the code folder names, oc and nrnoc. (Long ago, when object notation was added to hoc, the hoc folder was renamed to oc). At the moment, in neuron/__init__.py one can see that

h = hoc.HocObject()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement over existing implementation python
Projects
None yet
Development

No branches or pull requests

2 participants