LEMS / LEMS/jLEMS

Wrong dimensions in `condition` bits does not throw error

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
11
Forks
11
Avg merge
8h 6m
Merged PRs (30d)
1

Description

<neuroml xmlns="http://www.neuroml.org/schema/neuroml2"  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.1.xsd" id="kd3">
    <ionChannelHH id="kd3" species="K" conductance="10 pS">
        <annotation/>
        <gate id="n" instances="1" type="gateHHrates">
            <q10Settings type="q10ExpTemp" q10Factor="3" experimentalTemp="16 degC"/>
            <forwardRate type="HHNearlyExpLinearRate" rate="0.02 per_ms" midpoint="20 mV" scale="9 mV"/>
            <reverseRate type="HHNearlyExpLinearRate" rate="-0.002 per_ms" midpoint="20 mV" scale="-9 mV"/>
        </gate>
    </ionChannelHH>
    <ComponentType name="HHNearlyExpLinearRate" extends="baseHHRate" description="A HHExpLinearRate, but not quite">
        <Parameter name="scale" dimension="voltage"/>
        <Parameter name="midpoint" dimension="voltage"/>
        <Parameter name="rate" dimension="per_time"/>
        <Dynamics>
            <DerivedVariable name="x" dimension="voltage" value="(v - midpoint)"/>
            <ConditionalDerivedVariable name="r" dimension="per_time" exposure="r">
                <!-- the condition below should throw an error, the value bit should also throw an error, dimensions are wrong in both places -->
                <Case condition="x .neq. 0" value="rate * x/(1 - exp(0 - x/scale))"/>
                <Case value="rate"/>
            </ConditionalDerivedVariable>
        </Dynamics>
    </ComponentType>
</neuroml>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the NeuroML XML example, focusing on the condition and value expressions in the ConditionalDerivedVariable. Trace jLEMS's dimension validation for those expressions and add coverage showing that both mismatches raise errors; done means the supplied example no longer passes silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.