Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Improvements for handling python bindings CMake option#1244

Merged
pramodk merged 1 commit into
masterfrom
pramodk/pybind-cleanup
Apr 23, 2024
Merged

Improvements for handling python bindings CMake option#1244
pramodk merged 1 commit into
masterfrom
pramodk/pybind-cleanup

Conversation

@pramodk

@pramodk pramodk commented Apr 23, 2024

Copy link
Copy Markdown
Contributor
  • If -DNMODL_ENABLE_PYTHON_BINDINGS=OFF then there is no need to generate AST and other wrapper classes for Pybind11.
  • Using sympy-based solvers does not require Python bindings to be enabled. Avoid confusing warning when using nmodl binary.
  • When someone tries to use the nmodl module via Python, the warning is still preserved.
# before
$ nmodl mod_examples/sparse.mod
[NMODL] [warning] :: Python bindings are not available with this installation
..

# with this PR
$ nmodl mod_examples/sparse.mod
$ python3.11 -c "import nmodl"
[NMODL] [warning] :: Python bindings are not available with this installation

Next Step (Independent of this PR): * disable Python bindings in NRN build for normal neuron+coreneuron build

@matz-e / @ohm314: I think this is finally clarified.

- If `-DNMODL_ENABLE_PYTHON_BINDINGS=OFF` then there is no need
  to generate AST and other wrapper classes for Pybind11.
- Using sympy-based solvers does not require Python bindings to
  be enabled. Avoid confusing warning when using nmodl binary.
- When someone tries to use the nmodl module via Python, the
  warning is still preserved.

```console
$ nmodl mod_examples/sparse.mod
[NMODL] [warning] :: Python bindings are not available with this installation
..

$ nmodl mod_examples/sparse.mod
$ python3.11 -c "import nmodl"
[NMODL] [warning] :: Python bindings are not available with this installation
```
@pramodk pramodk requested a review from alkino April 23, 2024 13:01
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.50%. Comparing base (f6821ce) to head (f65fee0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1244   +/-   ##
=======================================
  Coverage   86.50%   86.50%           
=======================================
  Files         176      176           
  Lines       13176    13176           
=======================================
  Hits        11398    11398           
  Misses       1778     1778           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #206984 (:white_check_mark:) have been uploaded here!

Status and direct links:

@pramodk pramodk merged commit 8eb88e4 into master Apr 23, 2024
@pramodk pramodk deleted the pramodk/pybind-cleanup branch April 23, 2024 13:57
JCGoran pushed a commit to neuronsimulator/nrn that referenced this pull request Mar 12, 2025
…dl#1244)

- If `-DNMODL_ENABLE_PYTHON_BINDINGS=OFF` then there is no need
  to generate AST and other wrapper classes for Pybind11.
- Using sympy-based solvers does not require Python bindings to
  be enabled. Avoid confusing warning when using nmodl binary.
- When someone tries to use the nmodl module via Python, the
  warning is still preserved.

```console
$ nmodl mod_examples/sparse.mod
[NMODL] [warning] :: Python bindings are not available with this installation
..

$ nmodl mod_examples/sparse.mod
$ python3.11 -c "import nmodl"
[NMODL] [warning] :: Python bindings are not available with this installation
```

NMODL Repo SHA: BlueBrain/nmodl@8eb88e4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants