Repository: fbergmann/libSEDML (language: python)

Issue:
Unable to read UniformRange.numberOfPoints for L1V3 documents
libSED-ML can write `UniformRange.numberOfPoints`. Example:
```python
import libsedml

doc = libsedml.SedDocument()

task = doc.createRepeatedTask()
task.setId('task')

range = task.createUniformRange()
range.setId('uniformRange')
range.setStart(0.)
range.setEnd(10.)
range.setNumberOfPoints(10)
range.setType('linear')

filename = 'test.sedml'
libsedml.writeSedML(doc, filename)
assert doc.getErrorLog().getNumFailsWithSeverity(libsedml.LIBSEDML_SEV_ERROR) == 0
```

The example above produces the following SED-ML
```xml
<?xml version="1.0" encoding="UTF-8"?>
<sedML xmlns="http://sed-ml.org/sed-ml/level1/version3" level="1" version="3">
  <listOfTasks>
    <repeatedTask id="task">
      <listOfRanges>
        <uniformRange id="uniformRange" start="0" end="10" numberOfPoints="10" type="linear"/>
      </listOfRanges>
    </repeatedTask>
  </listOfTasks>
</sedML>
```

However, libSED-ML cannot read `UniformRange.numberOfPoints`. Continuing with the above example,

```python
doc2 = libsedml.readSedMLFromFile(filename)
assert doc2.getErrorLog().getNumFailsWithSeverity(libsedml.LIBSEDML_SEV_ERROR) == 0, doc2.getErrorLog().toString()
```

This produces the following error
```
(22503 [Error]) A <range> object must have the required attribute 'sedml:id'. No other attributes from the SBML Level 3 SEDML namespaces are permitted on a <range> object. 
Reference: L3V1 Sedml V1 Section
 An unknown attribute has been found.
 Attribute 'numberOfPoints' is not part of the definition of an SEDML Level 1 Version 3 <uniformRange> element.
```






Discussion / hints:
libSED-ML can read `numberOfSteps`, which isn't actually part of L1V3.

For example, libSED-ML can read the document below. The only difference between this and the above document is `numberOfPoints` is replaced with `numberOfSteps`.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<sedML xmlns="http://sed-ml.org/sed-ml/level1/version3" level="1" version="3">
  <listOfTasks>
    <repeatedTask id="task">
      <listOfRanges>
        <uniformRange id="uniformRange" start="0" end="10" numberOfSteps="10" type="linear"/>
      </listOfRanges>
    </repeatedTask>
  </listOfTasks>
</sedML>
```

this must have happened, when i accepted the prs: 

https://github.com/fbergmann/libSEDML/pull/83
https://github.com/fbergmann/libSEDML/pull/90

i'll add some test cases for these. 

Fix patch:
diff --git a/src/sedml/SedUniformRange.cpp b/src/sedml/SedUniformRange.cpp
index 5dfe3fc2..7ee9e449 100755
--- a/src/sedml/SedUniformRange.cpp
+++ b/src/sedml/SedUniformRange.cpp
@@ -841,7 +841,7 @@ SedUniformRange::addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER
 
   attributes.add("end");
 
-  attributes.add("numberOfSteps");
+  attributes.add("numberOfPoints");
 
   if (getVersion() >= 4 || getLevel() > 1) {
       attributes.add("numberOfSteps");


Test patch:
diff --git a/tests/TestIssues.cpp b/tests/TestIssues.cpp
index 31e80318..ef822cf5 100644
--- a/tests/TestIssues.cpp
+++ b/tests/TestIssues.cpp
@@ -326,3 +326,28 @@ TEST_CASE("Reading / Writing changexml only text node", "[sedml]")
   delete doc;
 }
 
+
+
+
+
+TEST_CASE("Reading numberOfPoints", "[sedml]")
+{
+  std::string fileName = getTestFile("/test-data/issue_93.sedml");
+  SedDocument* doc = readSedMLFromFile(fileName.c_str());
+  bool haveErrors = doc->getNumErrors(LIBSEDML_SEV_ERROR) != 0;
+  
+  if (haveErrors)
+    doc->getErrorLog()->printErrors();
+  
+  REQUIRE(!haveErrors);
+
+  {
+    auto* task = dynamic_cast<SedRepeatedTask*> (doc->getTask(0));
+    REQUIRE(task != NULL);
+    auto* range = dynamic_cast<SedUniformRange*> (task->getRange(0));
+    REQUIRE(range != NULL);
+    REQUIRE(range->isSetNumberOfPoints());
+    REQUIRE(range->getNumberOfPoints() == 10);
+  }
+  delete doc;
+}
diff --git a/tests/test-data/issue_93.sedml b/tests/test-data/issue_93.sedml
new file mode 100644
index 00000000..030e189e
--- /dev/null
+++ b/tests/test-data/issue_93.sedml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sedML xmlns="http://sed-ml.org/sed-ml/level1/version3" level="1" version="3">
+  <listOfTasks>
+    <repeatedTask id="task">
+      <listOfRanges>
+        <uniformRange id="uniformRange" start="0" end="10" numberOfPoints="10" type="linear"/>
+      </listOfRanges>
+    </repeatedTask>
+  </listOfTasks>
+</sedML>
\ No newline at end of file