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

Add test_hlines to test_datetimes.py #27211

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Conversation

CozyFrog
Copy link
Contributor

PR summary

I have added a datetime smoketest for Axes.hlines to lib/matplotlib/tests/test_datetime.py. This example is very similar to Axes.axhline (#27177) – but to test the entire functionality of hlines, I have done a combination of datetime.datetime/np.datetime64 arrays with both scalar and array xmin/xmax arguments.

Below is an image of the plot generated from this example code.
test_hlines

This addresses the Axes.hlines task from #26864.

PR checklist

Copy link
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

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

I think we also wish to test the xmin/xmax as dates here

@CozyFrog
Copy link
Contributor Author

Thank you for noting that, I did not think to check xmin/xmax as dates here - I have updated this test to do so, both with singular datetime values and datetime arrays.

This is what the plot generated by this example code looks like:
hlines_datetime_xmin_max

@CozyFrog
Copy link
Contributor Author

CozyFrog commented Nov 1, 2023

I added singular float arguments for xmin/xmax - I think that might be why one of the CodeCov checks did not pass.

Here is what the new plot looks like:
hlines_increased_coverage

@CozyFrog
Copy link
Contributor Author

CozyFrog commented Nov 1, 2023

@ksunden @scottshambaugh could I please have some advice on why the codecov/project/tests check is not passing? It's at 98.76% "compared to a589856" - I don't know why it's comparing this to the test for scatter.

@CozyFrog
Copy link
Contributor Author

CozyFrog commented Nov 9, 2023

If anybody is having the same issue, I think it stemmed simply from the fact that my branch was not current with the main body of work. Synchronizing it fixed the issue.

@ksunden ksunden merged commit 02489d4 into matplotlib:main Nov 21, 2023
40 checks passed
@QuLogic QuLogic added this to the v3.9.0 milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants