-
Notifications
You must be signed in to change notification settings - Fork 4
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 Issues with Shifting of Insets to Position and String to Decimal Converter #218
base: main
Are you sure you want to change the base?
Conversation
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.
I think there are still a few changes needed. Let me try and make those, but it would be good for you @nihalzp to still read my code comments so we can keep our programming standards the same and avoid future review comments.
std::cerr << "Hole: " << h << std::endl; | ||
std::cerr << "Polygon: " << ext_ring << std::endl; | ||
std::cerr << "GeoDiv: " << gd.id() << std::endl; | ||
std::cerr << "ERROR: Hole detected outside polygon!"; |
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.
We should change this to follow the style of the rest of our std::cerr
statements.
That is:
std:cerr << "Error: Hole detected outside polygon! "
<< "ABC"
<< "XYZ"
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.
Okay, I have added an issue for this.
{ | ||
auto &geo_divs = original_area ? geo_divs_original_transformed_ : geo_divs_; |
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.
Maybe it would be better to just store this in a variable? Or do you mean the current area of the geo_divs_transformed
, in which case probably we would want to change the name somehow.
Maybe "original_unit"?
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.
Storing the area in a variable would require us to update that variable each time we update the geo_divs
, which would require extra book keeping in many places, and this will increase the possibilities of bugs.
<< std::endl; | ||
std::cerr | ||
<< "ERROR: Input GeoJSON is not a longitude-latitude map. Therefore, " | ||
"it is not possible to produce an equal-area map." |
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.
Should we make this statement lighter. Or actually even remove it? Did you put it so that we can remember where this error came from?
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.
I feel we should not remove it; this way we know that the --output_equal_area
flag did not work for the given map. It is true that the statement contains redundant information because the first statement technically implies the second statement given the context. However, for a new user, it might not be obvious; and we do plan to display error messages to the users on the website.
@@ -410,11 +412,18 @@ int main(const int argc, const char *argv[]) | |||
|
|||
// Rescale insets in correct proportion to each other | |||
inset_state.normalize_inset_area( | |||
cart_info.cart_initial_total_target_area()); | |||
cart_info.cart_initial_total_target_area(), | |||
false, |
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.
Maybe we should name the bools? @mgastner's opinion on style may be helpful here.
The alternative is we keep it like this and rely on IDE hints.
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.
Good idea. Let's discuss it more.
@@ -15,7 +15,7 @@ void FTReal2d::set_array_size(const unsigned int i, const unsigned int j) | |||
void FTReal2d::allocate(const unsigned int lx, const unsigned int ly) | |||
{ | |||
if (lx * ly <= 0) { | |||
std::cerr << "Invalid array dimensions in FTReal2dArray::allocate_ft()" | |||
std::cerr << "ERROR: Invalid array dimensions in FTReal2dArray::allocate_ft()" | |||
<< std::endl; | |||
_Exit(98915); |
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.
On a side note, I wonder who is naming these exit codes.
We should also resolve
Here is the entire snippet. I am unsure whether it should be
EDIT: I fixed this in f0536c9 |
Improve and automate `benchmark.sh`
Closes #219
Closes #214
Closes #204
Closes #180