Repository navigation
Conversation
|
I think either way is somehow acceptable, but I have a slight preference for not putting the method into |
Yeah, after thinking over this I agree and will create a new class with just different defaults, to avoid too much friction when creating tests.
Ah, this was confusing. I more meant a new class that just extends GraphHopperOSM and is for Test (GraphHopperOSMForTest :) ?). Will try to find something simple.
This won't be possible as smaller unit tests will always have too few nodes. |
|
Why do you even create a new class? Now it looks like there's something special about subnetwork pruning, and you should always test GraphHopper without it. Can't you just set this parameter to 0 on the instance, with a config flag, only on the required tests? I think there's nothing wrong with copy-pasting it. Copy-paste is okay when every single case is special anyway, which is the case here. Hiding it behind a class like "ForTest" just makes it look like a clever generalization of something, rather than just setting a parameter that happens to be required. Or is it possible to create a special config file that is used for those tests instead of a class? |
|
Or is the problem that all the example networks just completely disappear because they are small? Then maybe go all the way and make the change we talked about: Let the "oneWay"-pruner behave like the regular one (not delete the biggest component, ..), and maybe even remove the other one? Or is that too hairy? |
Yes.
Yeah, you are right: keeping the biggest component should be done even it is is smaller than the config. |
|
Superseded by #2042 . |
We currently have
in config-example.yml and so we need to make it consistent in the GraphHopper class too. Unfortunately many tests need a change as the do not expect the PrepareRoutingSubnetworks to kick in. To make it a bit convenient I introduced GraphHopper.forTesting, but I'm unsure if we should introduce this there or better create a GraphHopperOSMTest class with this method instead.