Skip to content

Export configuration options to Python#1962

Merged
olupton merged 4 commits into
masterfrom
olupton/configuration-export
Aug 22, 2022
Merged

Export configuration options to Python#1962
olupton merged 4 commits into
masterfrom
olupton/configuration-export

Conversation

@olupton

@olupton olupton commented Aug 22, 2022

Copy link
Copy Markdown
Collaborator

This PR exports the values of CMake configuration options to Python, so one can do

from neuron import config
if config.arguments["NRN_ENABLE_MPI"]:
  # ...

The values of variables included in this list are available:

set(NRN_OPTION_NAME_LIST
NRN_ENABLE_SHARED
NRN_ENABLE_INTERVIEWS
NRN_ENABLE_MECH_DLL_STYLE
NRN_ENABLE_DISCRETE_EVENT_OBSERVER
NRN_ENABLE_PYTHON
NRN_ENABLE_THREADS
NRN_ENABLE_MPI
NRN_ENABLE_RX3D
NRN_ENABLE_CORENEURON
NRN_ENABLE_TESTS
NRN_ENABLE_MODEL_TESTS
NRN_ENABLE_MODULE_INSTALL
NRN_ENABLE_PYTHON_DYNAMIC
NRN_MODULE_INSTALL_OPTIONS
NRN_PYTHON_DYNAMIC
NRN_MPI_DYNAMIC
NRN_DYNAMIC_UNITS_USE_LEGACY
NRN_RX3D_OPT_LEVEL
NRN_SANITIZERS
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX
CMAKE_C_COMPILER
CMAKE_CXX_COMPILER
PYTHON_EXECUTABLE
IV_LIB
CORENRN_ENABLE_GPU)

Changes hoisted out of #1922. Closes #1923.

@olupton olupton force-pushed the olupton/configuration-export branch from aa91095 to 3b29b07 Compare August 22, 2022 11:59
@olupton olupton marked this pull request as ready for review August 22, 2022 13:10
@olupton olupton requested a review from alexsavulescu August 22, 2022 13:11
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #1962 (91bcb1a) into master (cc737a9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1962      +/-   ##
==========================================
+ Coverage   46.43%   46.45%   +0.01%     
==========================================
  Files         525      526       +1     
  Lines      119183   119226      +43     
==========================================
+ Hits        55340    55383      +43     
  Misses      63843    63843              
Impacted Files Coverage Δ
share/lib/python/neuron/__init__.py 40.23% <100.00%> (+0.14%) ⬆️
share/lib/python/neuron/config.py 100.00% <100.00%> (ø)
src/nrnoc/nrnversion.cpp 90.24% <100.00%> (+2.74%) ⬆️
src/oc/hoc_init.cpp 91.96% <100.00%> (+1.64%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@alexsavulescu alexsavulescu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread share/lib/python/neuron/config.py Outdated
@azure-pipelines

Copy link
Copy Markdown

✔️ 80f6a05 -> Azure artifacts URL

@olupton olupton merged commit 3c199fe into master Aug 22, 2022
@olupton olupton deleted the olupton/configuration-export branch August 22, 2022 15:03
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.

Python: improve feature testing from Python scripts

3 participants