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

help(gravity.parameters) raises exception #1089

Open
LourensVeen opened this issue Nov 3, 2024 · 1 comment
Open

help(gravity.parameters) raises exception #1089

LourensVeen opened this issue Nov 3, 2024 · 1 comment
Labels

Comments

@LourensVeen
Copy link
Collaborator

Describe the bug
The book says to use help(gravity.parameters) to show help for the parameters of a gravity code. If I do that (with Python 3.13, but I'm not sure that that's relevant), I get an exception instead of help.

To Reproduce
Steps to reproduce the behavior:

from amuse.community.brutus import Brutus
b = Brutus()
help(b.parameters)

Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    help(b.parameters)
    ~~~~^^^^^^^^^^^^^^
  File "<frozen _sitebuiltins>", line 103, in __call__
  File "/home/lourens/.miniconda3/envs/amuse-mpreal/lib/python3.13/pydoc.py", line 1992, in __call__
    self.help(request)
    ~~~~~~~~~^^^^^^^^^
  File "/home/lourens/.miniconda3/envs/amuse-mpreal/lib/python3.13/pydoc.py", line 2053, in help
    else: doc(request, 'Help on %s:', output=self._output, is_cli=is_cli)
          ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lourens/.miniconda3/envs/amuse-mpreal/lib/python3.13/pydoc.py", line 1759, in doc
    what = getattr(thing, '__qualname__', None)
  File "/home/lourens/NLeSC/projects/ReDiTSAp/software/amuse_lourens/src/amuse/datamodel/parameters.py", line 38, in __getattr__
    raise exceptions.CoreException(
    ...<2 lines>...
    )
amuse.support.exceptions.CoreException: tried to get unknown parameter '__qualname__' for a 'Brutus' object

Expected behavior
A clear and concise description of which parameters exist and what they mean.

Environment (please complete the following information):

  • OS and version: Kubuntu 22.04
  • Compiler: N/A

Additional context
Looking at parameters.py:35, there's two commented-out lines that seem like they could solve the problem, and indeed it works if I enable them again. Unfortunately there's no comment to explain why they're commented out, so I'm not sure if that breaks something else.

@LourensVeen LourensVeen added the bug label Nov 3, 2024
@rieder
Copy link
Member

rieder commented Nov 3, 2024

Specific for Brutus? Or also other community codes?
We should probably make a unittest for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants