Skip to content

Refactors and adds tests for the data class#76

Merged
DrPaulSharp merged 2 commits intoRascalSoftware:masterfrom
StephenNneji:data_class_tests
Feb 16, 2023
Merged

Refactors and adds tests for the data class#76
DrPaulSharp merged 2 commits intoRascalSoftware:masterfrom
StephenNneji:data_class_tests

Conversation

@StephenNneji
Copy link
Collaborator

Added tests for the DataClass. Refactors both "DataClass.m" and calling routines in "projectClass.m"

if dataRange(1) > dataRange(2)
warning('Data range min must not be greater than max - resetting');
dataRange(1) = realDataRange(1);
dataRange(2) = realDataRange(2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This relies on dataX being sorted. I know we discussed this in the meeting and it should be fine, but what are the problems if it isn't?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

might be good to throw an exception if realDataRange(1) > realDataRange(2)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Bingo! Sounds like a plan to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yup, sounds good....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What's the best exception for this? I am think of renaming the invalidOption to invalidValue

Copy link
Collaborator

Choose a reason for hiding this comment

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

invalidOption is for exceptions like "Model Type has to be Standard Layers, Custom Layers or Custom XY" - I'd keep that one as it is. This feels like a new exception to me, so maybe add invalidValue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

An invalidOption is basically and invalidValue for an Enum but its okay to separate out

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@DrPaulSharp DrPaulSharp mentioned this pull request Feb 16, 2023
13 tasks
@DrPaulSharp DrPaulSharp merged commit 46081d5 into RascalSoftware:master Feb 16, 2023
@StephenNneji StephenNneji deleted the data_class_tests branch April 12, 2023 15:50
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.

3 participants