earthlab / matplotcheck

A python package for checking and testing matplotlib plots. We use this for autograding student assignments but there are many other potential use cases including package testing (for packages with plots)!
https://matplotcheck.readthedocs.io
BSD 3-Clause "New" or "Revised" License
18 stars 8 forks source link

Consider rewriting or replacing assert_xticks_reformatted() #206

Closed marty-larocque closed 4 years ago

marty-larocque commented 4 years ago

Currently, the docstrings for the assert_xticks_reformatted() function suggest that it asserts how far apart the ticks are (i.e. 1 month apart, 1 year apart, 1 decade apart). In reality, what it does is check the formatting style for text on the ticks. For example, for loc_exp='day', it just checks whether the day is included in the formatting. (i.e. for the date January 18th, 2020, it just checks whether '18' would show up in the label.)

Additionally, this method means that the formatting would be no different between (loc_exp='decade' and loc_exp='year') or (loc_exp='month' and loc_exp='day').

Do we want this function to measure the distance between ticks? Do we want it to directly check the formatting style of the ticks?

marty-larocque commented 4 years ago

I was confused about the purpose of assert_xticks_reformatted(). Looks like this is addressed by assert_xticks_locs()