-
Notifications
You must be signed in to change notification settings - Fork 24
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
Also show measured distances in vx (in addition to nm) #5240
Conversation
…aces and formatted nicely
/** | ||
* Measures the length of the given tree and returns the length in nanometer and in voxels. | ||
*/ | ||
measureTreeLength(treeId: number): [number, number] { |
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.
The changes to the api's interface are a bit unfortunate. The probability that someone uses this feature is probably very low and the effort to fix it is quite small. This is why I don't want to bump the api version (which is quite a bit of overhead for us and also for our users which have to check how to upgrade). This is a good example why our current API versioning is sub-ideal :/
Do you agree with this approach, @MichaelBuessemeyer and @daniel-wer? Alternatively, I could keep the old methods and add measureTreeLengthInNmAndVx
, measureAllTrees InNmAndVx
and measurePathLengthBetweenNodesInNmAndVx
. However, that's also quite ugly..
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.
How about a third variant:
- Rename
measureTreeLength
tomeasureTreeLengthWithVX
or so. - And just call this method in
measureTreeLength
and just return the first value. This should match the interface of the old API right?
You can do the same steps for measurePathLengthBetweenNodes
.
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.
Nevertheless, I think your solution is fine. You can go ahead and merge this PR if you are against my proposed variant.
Users that would have to adapt their code should be able to handle this small interface change 👍
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.
How about a third variant:
Rename measureTreeLength to measureTreeLengthWithVX or so.
And just call this method in measureTreeLength and just return the first value. This should match the interface of the old API right?
Yes, that would also work (and is kind of what I meant with my suggestion to have an additional method à la measureTreeLengthInNmAndVx
). The one thing which bothers me here is the suboptimal naming of the methods (the old method is limited to nm, but would need to keep its name, and the new method is more powerful but would need to have a more specific name). However, I'm not completely against it. Let's wait for a third opinion :)
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.
Seeing that this method has only existed for a couple of months and its addition wasn't announced, I would also think usage is probably extremely small if not zero. You could include this change in the "breaking" section of the changelog :)
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.
You could include this change in the "breaking" section of the changelog :)
Good idea! I also agree with your risk assessment so this PR should be good to go now 🕺
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.
LGTM except for one small thingy. 🚀 🧊
frontend/javascripts/messages.js
Outdated
"tracing.tree_length_notification": (treeName: string, length: string) => | ||
`The tree ${treeName} has a total path length of ${length}.`, | ||
"tracing.tree_length_notification": (treeName: string, length: string, lengthInVx: string) => | ||
`The tree ${treeName} has a total path length of ${length} (${lengthInVx})`, |
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.
Did you intentionally remove the "." at the end or was this just by accident? I think a dot at the end makes sense as this is a complete sentence :)
Todo
URL of deployed dev instance (used for testing):
Steps to test:
Issues: