You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bumping to GMT 6.2.0rc1 will also affect several existing PRs. I think we should go ahead with bumping the version as soon as possible though (so that we can test and fix any new bugs). Is there any PR we would like to merge/finish before bumping PyGMT to use GMT 6.2.0rc1? Otherwise it will get lost under a torrent of PRs relating to fixing broken unit tests 😆
I was actually thinking of updating e4cb775/.github/workflows/dvc-diff.yml to have a side-by-side before/after comparison of the images (instead of just having a single new image shown).
@GenericMappingTools/pygmt-maintainers please give #1219 and #1218 a fast review and approval, otherwise, we won't finish the migration before the next 6.2.0rc2 or 6.2.0 release.
@GenericMappingTools/pygmt-maintainers please give #1219 and #1218 a fast review and approval, otherwise, we won't finish the migration before the next 6.2.0rc2 or 6.2.0 release.
I know we haven't updated the documentation for the maintainer review process yet, but I think these are good examples of when to use the 'request a review' option for pinging pygmt-maintainers. At least for me, I usually periodically skim the PRs for any that have been marked 'ready for review' or 'final review call' but will notice specific review requests immediately.
I think we may be encountering something flaky in PyGMT's test suite. There's 3 separate cases (opened by 3 different people) where using pytest pygmt/tests/test_somemodule.py passes on a specific module but make test fails for the whole test suite:
I understand the original logic behind a single GMT session for all tests in #327 (comment). Still, I don't expect that users will be attempting to use the entire PyGMT library in a single session, which is the goal of the test suite. So I think it would be worth revisiting this
For the purposes of quickly resolving this GMT 6.2.0rc1 baseline image update issue, specifically for makecpt at #1231 and fig.solar at #1232 (ignoring fig.grdview since that's about dvc migration), we'll need a quick workaround to get the tests green again. Do we want to 1) use @pytest.mark.xfail or 2) get the image that make test expects from https://github.com/GenericMappingTools/pygmt/actions/runs/787380280 under Artifacts and upload it to dvc or 3) something else?
Since option 2 will reverse the problem (i.e., fail with pytest pygmt/tests/test_makecpt.py), I am in favor of option 1 as an interim solution.
Similar to makecpt() tests in #1231, the Figure.soloar() tests (#1232) pass when running the single test, but fail when running with pygmt/tests/test_session_management.py. To reproduce it, you can check out the branch in #1232 and run:
If I delete the file pygmt/tests/test_session_management.py and run the full tests with make test, the Figure.solar() tests pass, but some other tests fail (in a good way). Here are the list of new failing tests after deleting pygmt/tests/test_session_management.py:
I didn't check all the tests, but it seems some baseline images are incorrect, but the tests on master branch pass. For example, for the test test_text_transparency, the current baseline image is incorrect:
Current baseline
Expected baseline
As far as I understand it, test files like pygmt/tests/test_session_management.py or docstrings that call import pygmt (e.g., pygmt/src/grdfilter.py) create new sessions or nested sessions, which cause problems for us. Since we don't see these problems with GMT 6.1.1, perhaps some upstream bugs (e.g., memory leakages) in GMT 6.2.0rc1?
Here is a minimal example to reproduce the flaky tests we're having:
from pygmt import Figure
from pygmt.clib import Session
from pygmt.session_management import begin, end
# check the current value of MAP_FRAME_AXES
with Session() as lib:
lib.call_module("get", "MAP_FRAME_AXES")
# plot the first image
fig = Figure()
fig.basemap(region=[0, 10, 10, 20], projection="X10c", frame=True)
fig.savefig("before.png")
# end the global session
end()
# start a new global session
begin()
# check the current value of MAP_FRAME_AXES
with Session() as lib:
lib.call_module("get", "MAP_FRAME_AXES")
# plot the second image
fig = Figure()
fig.basemap(region=[0, 10, 10, 20], projection="X10c", frame=True)
fig.savefig("after.png")
Just in case you don't know it:
import pygmt calls the begin() function, which is just the wrapper of gmt begin pygmt-session
when the script exits, the end() function is called, which is the wrapper of gmt end
The output of the two "gmt get" calls is:
auto
WESNZ
The resulting images are:
Before
After
Apparently, these two images diff due to the differences of MAP_FRAME_AXES settings (auto vs WESNZ). I think it's an upstream GMT bug. Please see if the minimal example can help you debug GMT. @PaulWessel @meghanrjones
No solution yet but it seems to be an issue with GMT_keyword_updated that was implemented as part of GenericMappingTools/gmt#3344. At the start of the second global session, GMT_keyword_updated is set to true for the options that were updated in gmtinit_conf_modern_override() in the first global session, which leads to a session-level gmt.conf file being written that contains the classic versions of the theme dependent parameters.
But, the two makecpt() tests still fail and I get a fatal error on pygmt/tests/test_grdtrack.py::test_grdtrack_input_dataframe_and_dataarray. I will merge GenericMappingTools/gmt#5178 since it is a needed correction. Then it will be necessary to sort out the remaining problems.
Thanks @seisman and @meghanrjones for tracking this down and fixing the bug. Sounds like we might need a GMT 6.2.0rc2? Let's put an xfail for the fig.solar tests at #1232 for now @seisman to get the tests passing (and close this issue). We can then track/fix the false positive passing tests (for subplot, text, and wiggle) later in a separate issue/PR.
I agree 6.2.0rc2 will be needed soon. Even though the gmt-dev CI tests are passing, I am still concerned about my local fatal error in pygmt/tests/test_grdtrack.py::test_grdtrack_input_dataframe_and_dataarray and would like to figure that out before releasing rc2. It would be helpful to know if anyone else gets a similar issue when testing using the gmt-dev branch. This is my setup:
I plan to look into this more tomorrow, but in the meantime this is the specific error that I get when trying to run output = grdtrack(points=dataframe, grid=dataarray, newcolname="bathymetry"): python grdtrack-test.py Assertion failed: (node < G->header->size), function gmt_bcr_get_z_fast, file ../src/gmt_bcr.c, line 256. Abort trap: 6
Agree on finding out what is causing the grdtrack fatal error before GMT 6.2.0rc2, I've just built the latest GMT from master (GenericMappingTools/gmt@a6980cb) and will try and see what's up. I'll probably work on it in the grdrack refactor PR at #1189.
Agree on finding out what is causing the grdtrack fatal error before GMT 6.2.0rc2, I've just built the latest GMT from master (GenericMappingTools/gmt@a6980cb) and will try and see what's up. I'll probably work on it in the grdrack refactor PR at #1189.
Thanks for checking. It was a silly mistake on my part in continuing on in debug mode even after being done with debugging so I ran into an assert statement 🤦♀️
With #1232 merged in, I think we can close this GMT 6.2.0rc1 issue. We should continue to track the test flakiness issue over at #1242, and open a separate "Bump to GMT 6.2.0rc2" issue later on to fix problematic tests.
Activity
weiji14 commentedon Apr 20, 2021
Bumping to GMT 6.2.0rc1 will also affect several existing PRs. I think we should go ahead with bumping the version as soon as possible though (so that we can test and fix any new bugs). Is there any PR we would like to merge/finish before bumping PyGMT to use GMT 6.2.0rc1? Otherwise it will get lost under a torrent of PRs relating to fixing broken unit tests 😆
I was actually thinking of updating https://github.com/GenericMappingTools/pygmt/blob/e4cb775346814dce46555a27c0c94f8e0aed6f04/.github/workflows/dvc-diff.yml to have a side-by-side before/after comparison of the images (instead of just having a single new image shown). Unsure if I have time this week to update that workflow (have a presentation and my PhD defence to prep for) but will see.
seisman commentedon Apr 20, 2021
I can work on this.
seisman commentedon Apr 21, 2021
@GenericMappingTools/pygmt-maintainers please give #1219 and #1218 a fast review and approval, otherwise, we won't finish the migration before the next 6.2.0rc2 or 6.2.0 release.
maxrjones commentedon Apr 21, 2021
I know we haven't updated the documentation for the maintainer review process yet, but I think these are good examples of when to use the 'request a review' option for pinging pygmt-maintainers. At least for me, I usually periodically skim the PRs for any that have been marked 'ready for review' or 'final review call' but will notice specific review requests immediately.
seisman commentedon Apr 21, 2021
I've merged #1218, so now the CI tests are running with GMT 6.2.0rc1, and ~100 tests fail, due to the modern theme changes introduced in GMT 6.2.
What we need to do to make the tests pass again:
conda install -c conda-forge/label/dev gmt=6.2.0rc1pytest pygmt/tests/test_basemap.pyresultsdirectory.baseline.pngandresult.pngimages. Do the differences make sense to you?pytest --mpl-generate-path=baseline pygmt/tests/test_basemap.pypygmt/tests/baselinedirectoryseisman commentedon Apr 21, 2021
Here is a list of test files that contain failing tests. Anyone is welcome to work on them.
Not failing, but wrong according to #1217 (comment)
weiji14 commentedon Apr 21, 2021
I'll handle all the test_grd*.py tests in a single PR if that's ok.
seisman commentedon Apr 21, 2021
OK to me.
weiji14 commentedon Apr 21, 2021
Cool, can we also agree on a standardized PR title? E.g. "Update fig.??? baseline images for GMT 6.2.0rc1"?
seisman commentedon Apr 21, 2021
Good.
weiji14 commentedon Apr 23, 2021
I think we may be encountering something flaky in PyGMT's test suite. There's 3 separate cases (opened by 3 different people) where using
pytest pygmt/tests/test_somemodule.pypasses on a specific module butmake testfails for the whole test suite:fig.solarUpdate fig.solar baseline images for GMT 6.2.0rc1 #1232 (comment)fig.grdviewMigrate Figure.grdview tests to dvc #1154 (comment)pygmt.makecptUpdate makecpt baseline images for GMT 6.2.0rc1 #1231 (comment)This reminds me of https://github.com/GenericMappingTools/pygmt/pull/476/files#r453429872 (which motivated the use of a
@pytest.mark.runfirstdecorator, @seisman will remember this). The 3 cases above may well be 3 separate issues, but they seem to be too much of a coincidence. We'll need to track down whether this is an upstream GMT issue, or something wrong with the test suite on PyGMT's side, and this will require quite a bit of detective work.6 remaining items
maxrjones commentedon Apr 27, 2021
Since option 2 will reverse the problem (i.e., fail with
pytest pygmt/tests/test_makecpt.py), I am in favor of option 1 as an interim solution.seisman commentedon Apr 27, 2021
Option 1 👍
seisman commentedon Apr 27, 2021
A little progress on the flaky tests.
Similar to
makecpt()tests in #1231, theFigure.soloar()tests (#1232) pass when running the single test, but fail when running withpygmt/tests/test_session_management.py. To reproduce it, you can check out the branch in #1232 and run:If I delete the file
pygmt/tests/test_session_management.pyand run the full tests withmake test, theFigure.solar()tests pass, but some other tests fail (in a good way). Here are the list of new failing tests after deletingpygmt/tests/test_session_management.py:I didn't check all the tests, but it seems some baseline images are incorrect, but the tests on master branch pass. For example, for the test
test_text_transparency, the current baseline image is incorrect:As far as I understand it, test files like
pygmt/tests/test_session_management.pyor docstrings that callimport pygmt(e.g.,pygmt/src/grdfilter.py) create new sessions or nested sessions, which cause problems for us. Since we don't see these problems with GMT 6.1.1, perhaps some upstream bugs (e.g., memory leakages) in GMT 6.2.0rc1?seisman commentedon Apr 27, 2021
Actually, on the master branch, the
Figure.text()tests fail when runningpytest pygmt/tests/test_text.py, but pass withmake test.seisman commentedon Apr 27, 2021
Here is a minimal example to reproduce the flaky tests we're having:
Just in case you don't know it:
import pygmtcalls thebegin()function, which is just the wrapper ofgmt begin pygmt-sessionend()function is called, which is the wrapper ofgmt endThe output of the two "gmt get" calls is:
The resulting images are:
Apparently, these two images diff due to the differences of
MAP_FRAME_AXESsettings (autovsWESNZ). I think it's an upstream GMT bug. Please see if the minimal example can help you debug GMT. @PaulWessel @meghanrjonesmaxrjones commentedon Apr 27, 2021
Thanks for the the minimal example @seisman. I will see what I can find about this.
maxrjones commentedon Apr 28, 2021
No solution yet but it seems to be an issue with
GMT_keyword_updatedthat was implemented as part of GenericMappingTools/gmt#3344. At the start of the second global session,GMT_keyword_updatedis set to true for the options that were updated ingmtinit_conf_modern_override()in the first global session, which leads to a session-levelgmt.conffile being written that contains the classic versions of the theme dependent parameters.maxrjones commentedon Apr 28, 2021
GenericMappingTools/gmt#5178 fixes the minimal example and make these tests fail (some now in a proper way):
But, the two
makecpt()tests still fail and I get a fatal error onpygmt/tests/test_grdtrack.py::test_grdtrack_input_dataframe_and_dataarray. I will merge GenericMappingTools/gmt#5178 since it is a needed correction. Then it will be necessary to sort out the remaining problems.weiji14 commentedon Apr 29, 2021
Thanks @seisman and @meghanrjones for tracking this down and fixing the bug. Sounds like we might need a GMT 6.2.0rc2? Let's put an xfail for the
fig.solartests at #1232 for now @seisman to get the tests passing (and close this issue). We can then track/fix the false positive passing tests (forsubplot,text, andwiggle) later in a separate issue/PR.maxrjones commentedon Apr 29, 2021
I agree 6.2.0rc2 will be needed soon. Even though the gmt-dev CI tests are passing, I am still concerned about my local fatal error in
pygmt/tests/test_grdtrack.py::test_grdtrack_input_dataframe_and_dataarrayand would like to figure that out before releasing rc2. It would be helpful to know if anyone else gets a similar issue when testing using the gmt-dev branch. This is my setup:I plan to look into this more tomorrow, but in the meantime this is the specific error that I get when trying to run
output = grdtrack(points=dataframe, grid=dataarray, newcolname="bathymetry"):python grdtrack-test.py Assertion failed: (node < G->header->size), function gmt_bcr_get_z_fast, file ../src/gmt_bcr.c, line 256. Abort trap: 6weiji14 commentedon Apr 29, 2021
Agree on finding out what is causing the
grdtrackfatal error before GMT 6.2.0rc2, I've just built the latest GMT from master (GenericMappingTools/gmt@a6980cb) and will try and see what's up. I'll probably work on it in thegrdrackrefactor PR at #1189.Edit: I can't reproduce the fatal error on Linux, and the 'macOS-11.0 - GMT master' test didn't seem to crash either at https://github.com/GenericMappingTools/pygmt/runs/2463360992?check_suite_focus=true#step:15:272.
maxrjones commentedon Apr 29, 2021
Thanks for checking. It was a silly mistake on my part in continuing on in debug mode even after being done with debugging so I ran into an assert statement 🤦♀️
weiji14 commentedon Apr 30, 2021
With #1232 merged in, I think we can close this GMT 6.2.0rc1 issue. We should continue to track the test flakiness issue over at #1242, and open a separate "Bump to GMT 6.2.0rc2" issue later on to fix problematic tests.