smiths / caseStudies

Case studies of (manual) documentation for scientific computing software
3 stars 2 forks source link

Assuming "x" is within bounds for index function #133

Closed niazim3 closed 6 years ago

niazim3 commented 6 years ago

Under the MIS for the SeqServices module

image. There is no isInBounds function defined in the MIS, so what bounds is this assumption referring to? If it's referring to the bounds that are defined below the assumption (i.e. Xi <= x < Xi+1), then I don't think it should be an assumption since the definition states the boundaries there.

smiths commented 6 years ago

You are correct that this is ambiguous. In bounds in this case means X[0] <= x <= X[|X|-1]. It isn't possible to return an index for x if it lies outside of the data in X. Can you please update the MIS to include this clarification.

niazim3 commented 6 years ago

Makes sense, I can add this function from an assignment from 2ME3: image 😄

smiths commented 6 years ago

Yes, you can add this function. Good idea.