-
Notifications
You must be signed in to change notification settings - Fork 29
Conversation
Should close cphyc#121
for more information, see https://pre-commit.ci
Adjusted docstring to desired maximum line length
for more information, see https://pre-commit.ci
Changed the `xvals` argument to `vals` to reflect the changes made in commit e853d34
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.
Thanks for the implementation! This looks good overall, but I have slight concerns about backward compatibility. Also, would it be possible to add test(s) for this? To do so, please read pytest-mpl doc and add the reference image in labellines/baseline.
Note about tests: there is some tiny variation from one run to another on Github Action, leading to some tests failing. I haven't been able to troubleshoot it, but you can keep an eye on the tests results found in the artifacts of the runs.
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.
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 am overall happy with the val/axis combination. Two notes though
- we need to keep the old (
yoffset,yoffset_logspace) for backward compatibility - add a note in the docstring below to explain how to use the axis kwa?
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.
Same comment as above about maintaining backward compatibility.
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.
This should have the same signature as above (i.e. axis defaults to x).
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.
Once you update the signature, don't forget to update the docstring as well ;)
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.
Since the check below will be performed at different locations (here and at line 174), I'd suggest factorising it somehow.
I would also recommend explicitly testing the axis to be either x, y or otherwise fail with an error.
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.
This doesn't implement the logic for the y axis.
pevoz23
commented
May 12, 2023
Thanks for the implementation! This looks good overall, but I have slight concerns about backward compatibility. Also, would it be possible to add test(s) for this? To do so, please read pytest-mpl doc and add the reference image in
labellines/baseline.Note about tests: there is some tiny variation from one run to another on Github Action, leading to some tests failing. I haven't been able to troubleshoot it, but you can keep an eye on the tests results found in the artifacts of the runs.
Hey! Thanks for your review! I agree with all your comments and will work on them as soon as possible (likely in the next few days).
kavanase
commented
Aug 17, 2024
Just to bump, this would be a very useful feature if it could be included!
Our use case is for labelling the chemical formulae of materials in phase diagrams (used in computational materials science research), and we have some smart algorithms for picking the label positions, but for vertical lines we can't set y so it always places the label at the y-midpoint which isn't always desirable (e.g. "P" here):
image
cphyc
commented
Aug 19, 2024
I'd be happy for someone to review the PR once the comments have been fixed (this one, or an offspring of it retaining authorship to @pevoz23) but I unfortunately do not have the time to do this myself.
kavanase
commented
Jun 21, 2025
@pevoz23 do you have the time to implement the review comments on this?
Should close #121