-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix ValueAtPoints data type #652
Conversation
FYI: @danieldouglas92 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #652 +/- ##
=======================================
Coverage 92.82% 92.82%
=======================================
Files 105 105
Lines 7176 7176
=======================================
Hits 6661 6661
Misses 515 515
Continue to review full report in Codecov by Sentry.
|
|
Hm, doesn't compile on the tester?! |
hmm, so it turns out that rapidjson doesn't support size_t for this part of the conversion directly: WorldBuilder/include/rapidjson/document.h Lines 987 to 1050 in d9c2f64
We could use a unsigned int or int64_t instead, or cast it to a int64_t where it is used, or try to implement it. |
max_values_in_array should be an integer not a double. Also update schema files.
…o make the mac compiler happy.
6074b24
to
beaa8f3
Compare
@tjhei are you oke with this solution, turining the |
Yes, sorry didn't get time to update yet |
I updated it for you :) |
@@ -117,7 +117,7 @@ namespace WorldBuilder | |||
prm.declare_entry("density", Types::Double(3300), | |||
"The reference density of the subducting plate in $kg/m^3$"); | |||
|
|||
prm.declare_entry("plate velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<size_t>::max()))), | |||
prm.declare_entry("plate velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<uint64_t>::max()))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use uint max for doubles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That contains the max number of elements:
WorldBuilder/source/world_builder/types/value_at_points.cc
Lines 31 to 33 in d9c2f64
ValueAtPoints::ValueAtPoints(const double default_value_, | |
size_t max_values_in_array_, | |
std::vector<Point<2>> default_points_) |
max_values_in_array should be an integer not a double.
Also update schema files.