Skip to content
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

Keep min transfer filter is not local to group-by-filters #5436

Merged
merged 5 commits into from Nov 17, 2023

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Oct 17, 2023

Summary

Sometimes a group-by-filter removes the itinerary with the smallest number of transfers. This is not wanted, since few transfers is important to most users. Because, of this we have a filter witch reverse the removal of an itinerary by any of the group-by-filters if the it removes the best option with respect to transfers. The problem is that this filter do not inspect why the itinerary is removed. The reversal should only be applied to the group-by-filter tags, not other filters.

Issue

No issue.
This build on #5433, ready for review when #5433 is merged.

Unit tests

Updated.

Documentation

There are no config for this feature; Hence only JavaDoc to update.

Changelog

This is a minor bug fix.

Bumping the serialization version id

The serialization is not affected.

@t2gran t2gran added bug Entur On Entur Roadmap labels Oct 17, 2023
@t2gran t2gran added this to the 2.5 (next release) milestone Oct 17, 2023
@t2gran t2gran requested a review from a team as a code owner October 17, 2023 14:17
@t2gran t2gran marked this pull request as draft October 17, 2023 14:18
@t2gran t2gran force-pushed the otp2_fix_not_filter_min_tx branch 2 times, most recently from c462279 to 3cff98c Compare November 3, 2023 13:53
@t2gran t2gran marked this pull request as ready for review November 13, 2023 22:51
@t2gran
Copy link
Member Author

t2gran commented Nov 13, 2023

I think the elevation snapshot test fails because of this:

Nov 14, 2023 12:38:35 AM org.geotools.coverage.grid.io.AbstractGridCoverage2DReader getPamDataset
INFO: GDAL_METADATA tag contents could not be parsed
java.lang.NullPointerException: Cannot invoke "javax.xml.bind.JAXBContext.createUnmarshaller()" because "it.geosolutions.imageioimpl.plugins.tiff.gdal.GDALMetadataParser.CONTEXT" is null
	at it.geosolutions.imageioimpl.plugins.tiff.gdal.GDALMetadataParser.parse(GDALMetadataParser.java:59)
	at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.getPamDataset(AbstractGridCoverage2DReader.java:1419)
	at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.getPamDataset(AbstractGridCoverage2DReader.java:1405)
	at org.geotools.gce.geotiff.GeoTiffReader.getHRInfo(GeoTiffReader.java:390)
	at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:274)
	at org.geotools.gce.geotiff.GeoTiffFormat.getReader(GeoTiffFormat.java:335)
	at org.opentripplanner.graph_builder.module.ned.GeotiffGridCoverageFactoryImpl.getUninterpolatedGridCoverage(GeotiffGridCoverageFactoryImpl.java:85)
	at org.opentripplanner.graph_builder.module.ned.GeotiffGridCoverageFactoryImpl.getGridCoverage(GeotiffGridCoverageFactoryImpl.java:47)
	at org.opentripplanner.graph_builder.module.ned.GeotiffGridCoverageFactoryImpl.getGridCoverage(GeotiffGridCoverageFactoryImpl.java:23)
	at org.opentripplanner.graph_builder.module.ned.ElevationModule.getThreadSpecificCoverageInterpolator(ElevationModule.java:504)
	at org.opentripplanner.graph_builder.module.ned.ElevationModule.processEdge(ElevationModule.java:398)
	at org.opentripplanner.graph_builder.module.ned.ElevationModule.processEdgeWithProgress(ElevationModule.java:363)
	at org.opentripplanner.graph_builder.module.ned.ElevationModule.buildGraph(ElevationModule.java:210)
	at org.opentripplanner.ConstantsForTests.buildNewPortlandGraph(ConstantsForTests.java:151)
	at org.opentripplanner.ConstantsForTests.getCachedPortlandGraphWithElevation(ConstantsForTests.java:262)
	at org.opentripplanner.routing.algorithm.mapping.SnapshotTestBase.loadGraphBeforeClass(SnapshotTestBase.java:79)
	at org.opentripplanner.routing.algorithm.mapping.ElevationSnapshotTest.beforeClass(ElevationSnapshotTest.java:57)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(TimeoutExtension.java:128)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptBeforeAllMethod(TimeoutExtension.java:70)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllMethods$13(ClassBasedTestDescriptor.java:412)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllMethods(ClassBasedTestDescriptor.java:410)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:216)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:85)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)

Anyone seen this before? Note! this happens in the test setup.

@leonardehrenfried
Copy link
Member

The stacktrace is not the root of the problem but I also cannot figure out what it is so I recommend to remove the test.

Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

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

I only noticed typos.

@t2gran
Copy link
Member Author

t2gran commented Nov 14, 2023

The stacktrace is not the root of the problem but I also cannot figure out what it is so I recommend to remove the test.

I will disable it for now - then if someone want to take a look they can.

t2gran and others added 2 commits November 14, 2023 14:26
Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (112e9ad) 66.85% compared to head (277d83c) 66.87%.
Report is 38 commits behind head on dev-2.x.

Files Patch % Lines
...pplanner/framework/collection/CollectionUtils.java 71.42% 1 Missing and 1 partial ⚠️
...pentripplanner/api/mapping/SystemNoticeMapper.java 0.00% 1 Missing ⚠️
...n/java/org/opentripplanner/model/SystemNotice.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5436      +/-   ##
=============================================
+ Coverage      66.85%   66.87%   +0.02%     
- Complexity     15655    15679      +24     
=============================================
  Files           1817     1818       +1     
  Lines          70160    70240      +80     
  Branches        7383     7392       +9     
=============================================
+ Hits           46904    46972      +68     
- Misses         20798    20810      +12     
  Partials        2458     2458              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t2gran t2gran merged commit df0422b into opentripplanner:dev-2.x Nov 17, 2023
5 checks passed
@t2gran t2gran deleted the otp2_fix_not_filter_min_tx branch November 17, 2023 11:58
t2gran pushed a commit that referenced this pull request Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Entur On Entur Roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants