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

Remove toggling of TABLE from hh.mod (CoreNEURON + NMODL compatibility) #3093

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -747,22 +747,17 @@ add_custom_target(
# =============================================================================
if(NRN_ENABLE_CORENEURON OR NRN_ENABLE_MOD_COMPATIBILITY)
set(GLOBAL_VAR_TOGGLE_COMMAND "'s/ GLOBAL minf/ RANGE minf/'")
set(TABLE_VAR_TOGGLE_COMMAND "'s/ TABLE minf/ :TABLE minf/'")
else()
set(GLOBAL_VAR_TOGGLE_COMMAND "'s/ RANGE minf/ GLOBAL minf/'")
set(TABLE_VAR_TOGGLE_COMMAND "'s/ :TABLE minf/ TABLE minf/'")
endif()
separate_arguments(GLOBAL_VAR_TOGGLE_COMMAND UNIX_COMMAND "${GLOBAL_VAR_TOGGLE_COMMAND}")
separate_arguments(TABLE_VAR_TOGGLE_COMMAND UNIX_COMMAND "${TABLE_VAR_TOGGLE_COMMAND}")
add_custom_target(
hh_update
COMMAND sed ${GLOBAL_VAR_TOGGLE_COMMAND} ${CMAKE_SOURCE_DIR}/src/nrnoc/hh.mod >
${CMAKE_BINARY_DIR}/hh.mod.1
COMMAND sed ${TABLE_VAR_TOGGLE_COMMAND} ${CMAKE_BINARY_DIR}/hh.mod.1 >
${CMAKE_BINARY_DIR}/hh.mod.2
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/hh.mod.2
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/hh.mod.1
${CMAKE_SOURCE_DIR}/src/nrnoc/hh.mod
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/hh.mod.1 ${CMAKE_BINARY_DIR}/hh.mod.2
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/hh.mod.1
COMMENT "Update hh.mod for CoreNEURON compatibility"
VERBATIM)
add_dependencies(nrniv_lib hh_update)
Expand Down
2 changes: 1 addition & 1 deletion src/coreneuron/mechanism/mech/modfile/hh.mod
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ DERIVATIVE states {
PROCEDURE rates(v(mV)) { :Computes rate and other constants at current v.
:Call once from HOC to initialize inf at resting v.
LOCAL alpha, beta, sum, q10
: TABLE minf, mtau, hinf, htau, ninf, ntau DEPEND celsius FROM -100 TO 100 WITH 200
TABLE minf, mtau, hinf, htau, ninf, ntau DEPEND celsius FROM -100 TO 100 WITH 200

UNITSOFF
q10 = 3^((celsius - 6.3)/10)
Expand Down
6 changes: 1 addition & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ list(APPEND TESTS ringtest)
# Add small hoc test
# =============================================================================
set(HOCTEST_DIR ${PROJECT_SOURCE_DIR}/test/hoc_tests/connect_dend)
if(NRN_ENABLE_CORENEURON OR NRN_ENABLE_MOD_COMPATIBILITY)
set(REF_FILE cell3soma.core.dat.ref)
else()
set(REF_FILE cell3soma.dat.ref)
endif()
set(REF_FILE cell3soma.dat.ref)
add_test(
connect_dend
${CMAKE_COMMAND}
Expand Down
6 changes: 0 additions & 6 deletions test/api/hh_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@ using std::endl;
using std::ofstream;

constexpr std::array<double, 3> EXPECTED_V{
#ifndef CORENEURON_ENABLED
-0x1.04p+6,
-0x1.b254ad82e20edp+5,
-0x1.24a52af1ab463p+6,
#else
-0x1.04p+6,
-0x1.b0c75635b5bdbp+5,
-0x1.24a84bedb7246p+6,
#endif
};

extern "C" void modl_reg(){/* No modl_reg */};
Expand Down
9 changes: 0 additions & 9 deletions test/api/netcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@ using std::endl;
using std::ofstream;

constexpr std::array<double, 6> EXPECTED_V{
#ifndef CORENEURON_ENABLED
-0x1.04p+6,
-0x1.085a63d029bc3p+6,
-0x1.112a5e95eb67cp+6,
-0x1.1795abaec26c1p+6,
-0x1.0422351f3f9dcp+6,
-0x1.03e5317ac368cp+6,
#else
-0x1.04p+6,
-0x1.085a703d657a7p+6,
-0x1.112d0039e9c38p+6,
-0x1.17974aa201b7bp+6,
-0x1.041fdf57a182bp+6,
-0x1.03e58fad20b92p+6,
#endif
};

extern "C" void modl_reg(){/* No modl_reg */};
Expand Down
4 changes: 2 additions & 2 deletions test/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ include(FetchContent)
FetchContent_Declare(
ringtest
GIT_REPOSITORY https://github.com/neuronsimulator/ringtest
GIT_TAG 4ede4751c68f72a9884c6af4f94f65ff638054a8
GIT_TAG cab43b04b46786df2988a8c9e73eed0e91097384
SOURCE_DIR ${PROJECT_SOURCE_DIR}/external/tests/ringtest)

FetchContent_Declare(
testcorenrn
GIT_REPOSITORY https://github.com/neuronsimulator/testcorenrn
GIT_TAG 014aab9bee60a2bdd44b28a784c88092d2f6b92b
GIT_TAG 83d0e243ab226283f519e86b1ac82df3496aac74
SOURCE_DIR ${PROJECT_SOURCE_DIR}/external/tests/testcorenrn)

FetchContent_Declare(
Expand Down
203 changes: 0 additions & 203 deletions test/hoc_tests/connect_dend/cell3soma.core.dat.ref

This file was deleted.

Loading