Skip to content

Adding Shifter implementation#922

Merged
osana merged 5 commits into
masterfrom
osana-shifter
Dec 3, 2018
Merged

Adding Shifter implementation#922
osana merged 5 commits into
masterfrom
osana-shifter

Conversation

@osana

@osana osana commented Nov 13, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@zugaldia zugaldia requested a review from langsmith November 26, 2018 18:00
@springmeyer

springmeyer commented Nov 26, 2018

Copy link
Copy Markdown

Thank you for this work @osana and the Android team. As a downstream dependency is waiting on this, could I ask for a summary of what remains on this PR before merging and an overall description of what it entails?

@osana

osana commented Nov 26, 2018

Copy link
Copy Markdown
Contributor Author

@springmeyer We need to figure out how to make sure
fromJson->toJson->fromJson result in equal objects.

@osana osana requested a review from LukasPaczos November 27, 2018 19:38
@langsmith

Copy link
Copy Markdown

Once #925 lands, let's make sure to rebase this pr so that code coverage reporting gets applied to this work

@langsmith

Copy link
Copy Markdown

I've just rebased this branch to account for #925 landing in master

* Sets CoordinateShifterManager.
*
* @param coordinateShifter CoordinateShifterManager to be set
* @since 4.1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We'll need to switch to 4.1.1

@langsmith

Copy link
Copy Markdown

Made some commits to clean up javadoc, which now means that I can't give approval through Github. Looks good to me. Would love some final review from you @LukasPaczos .

As discussed offline with @springmeyer , let's now worry about getting Codecov to accurately report on this particular pr. @osana 's taken the time to write many tests for the work being added on this pr, so we know we've got solid coverage. Once this pr is merged to master, we can see how much of this work is uncovered and then open a new pr to add additional tests. Let's not have Codecov funkiness on this pr, block this work entirely. Ticketed #933 so that we don't forget to check for any other needed code coverage.

@springmeyer

Copy link
Copy Markdown

See this is failing now with:

:services-geojson:checkstyleMain[ant:checkstyle] [ERROR] /root/code/services-geojson/src/main/java/com/mapbox/geojson/shifter/CoordinateShifter.java:32: Line continuation have incorrect indentation level, expected level should be 2. [JavadocTagContinuationIndentation]
FAILED

@langsmith possible to get this landed tomorrow and released?

@osana

osana commented Dec 3, 2018

Copy link
Copy Markdown
Contributor Author

@LukasPaczos could you review this. @langsmith did changes to it so he cannot review it. Thanks

@LukasPaczos LukasPaczos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we are always operating on points which have fixed values counts, wouldn't working on primitive arrays instead of lists make it significantly faster and cheaper memory-wise?

@osana

osana commented Dec 3, 2018

Copy link
Copy Markdown
Contributor Author

@LukasPaczos
List instantiation was moved into the shifter so we are not creating more Lists than we did before. Only one is created that is needed for new AutoValue_Point(TYPE, null, coordinates)

I can change the interface for unshifting though :
double[] unshiftPoint(Point)
double[] unshiftPoint(List<Double>)

@LukasPaczos LukasPaczos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Capturing from an internal conversation that List<Double> instead of primitives was a direction taken in the past and to keep API consistent, we should keep the list as the return type of the shifter interface.

* ShifterManager allows the movement of all Point objects according to a custom algorithm.
* Once set, it will be applied to all Point objects created through this method.
*
* @since 4.1.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As this is a new API, the version should probably be 4.2.0.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think you are right! Thank you @LukasPaczos

@Test
public void bbox_basic_shift() throws Exception {

CoordinateShifter shifter = new TestCoordinateShifter();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shifter seems unused here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch - updating!

@osana osana merged commit d167cc6 into master Dec 3, 2018
@osana osana deleted the osana-shifter branch December 3, 2018 22:01
@springmeyer

Copy link
Copy Markdown

Thanks for landing this @osana @langsmith @LukasPaczos 🙌

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.

4 participants