Applied-GeoSolutions / multitemporal

Efficient, chainable time series processing of raster stacks.
GNU General Public License v2.0
4 stars 3 forks source link

43 port multitemporal to python 3 #44

Closed ra-tolson closed 4 years ago

ra-tolson commented 4 years ago

Fixes #43. I tried to keep the refactoring to a minimum, but I did find it easier to understand the source after I'd renamed a few variables. Also:

Regarding the test suite:

bhbraswell commented 4 years ago

I'm embarrassed to say I just started doing this separately, realized I had told you that I already did it, which is not true, and then realized that you did it yourself and that this PR was sitting here.

bhbraswell commented 4 years ago

The other thing I noticed is my test didn't pass because I was missing test_1.json so I was going to ask about that. Now I'll look at this whole thing and try it out.

ra-tolson commented 4 years ago

Okay, happy to help if you want to post questions etc. Any feedback would be welcome too.

I regret to say I didn't save my test invocation line but it was probably just $ pytest -s -vv from inside a built container; you shouldn't need any ancillary json files I don't think.

bhbraswell commented 4 years ago

Looks like there's possibly a version incompatibility, I'm getting

rob@MBP-18-111:~/repo/multitemporal$ docker run -it --rm multitemporal pytest
=========================================================================================== test session starts ============================================================================================
platform linux -- Python 3.6.7, pytest-5.2.2, py-1.8.0, pluggy-0.13.0
rootdir: /usr/local
plugins: cov-2.8.1
collected 402 items / 3 errors / 399 selected                                                                                                                                                              

================================================================================================== ERRORS ==================================================================================================
_______________________________________________________ ERROR collecting lib/python3.6/dist-packages/Cython/Debugger/Tests/test_libcython_in_gdb.py ________________________________________________________
ImportError while importing test module '/usr/local/lib/python3.6/dist-packages/Cython/Debugger/Tests/test_libcython_in_gdb.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
lib/python3.6/dist-packages/Cython/Debugger/Tests/test_libcython_in_gdb.py:24: in <module>
    import gdb
E   ModuleNotFoundError: No module named 'gdb'
_______________________________________________________ ERROR collecting lib/python3.6/dist-packages/Cython/Debugger/Tests/test_libpython_in_gdb.py ________________________________________________________
ImportError while importing test module '/usr/local/lib/python3.6/dist-packages/Cython/Debugger/Tests/test_libpython_in_gdb.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
lib/python3.6/dist-packages/Cython/Debugger/Tests/test_libpython_in_gdb.py:12: in <module>
    import gdb
E   ModuleNotFoundError: No module named 'gdb'
____________________________________________________________ ERROR collecting lib/python3.6/dist-packages/importlib_metadata/tests/test_zip.py _____________________________________________________________
ImportError while importing test module '/usr/local/lib/python3.6/dist-packages/importlib_metadata/tests/test_zip.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
lib/python3.6/dist-packages/importlib_metadata/tests/test_zip.py:7: in <module>
    from importlib.resources import path
E   ModuleNotFoundError: No module named 'importlib.resources'

During handling of the above exception, another exception occurred:
lib/python3.6/dist-packages/importlib_metadata/tests/test_zip.py:9: in <module>
    from importlib_resources import path
E   ModuleNotFoundError: No module named 'importlib_resources'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================= 3 error in 1.14s =============================================================================================
bhbraswell commented 4 years ago

Sorry. I did a fresh checkout and it worked. This is fantastic, thanks.

ra-tolson commented 4 years ago

great, so glad it's working for you!

bhbraswell commented 4 years ago

So unless I'm missing something, pip install -e will create the importable .so files in the source tree which is overwritten if you mount the /multitemporal to the container, and unless the compiled code is already there for some reason, mt won't be able to find the modules. I think this is why the directions at the bottom of the readme don't work for me (unless I drop the -v [stuff]). This raises the question of how do I operate the container when I'm developing. Maybe. Am I just doing it wrong?

ra-tolson commented 4 years ago

@bhbraswell I think you discovered that I forgot a step. I altered the readme; if you want you can try it again.

But by all means develop in whatever way is most comfortable to you; I'm sure the mount isn't required if you're installing an editor in your container.

ircwaves commented 4 years ago

OK, now I see what you're saying. And I think the line added to the readme by Tom's last commit helps with this. If you're going to develop on a mounted (-v /path/to/my/mt/dir:/multitemporal) repo, you do need to build the modules. Does that make sense @bhbraswell? We can meet for a couple minutes to clear this up if it doesn't. I def could be misunderstanding something here.

bhbraswell commented 4 years ago

Sorry, it seems obvious in retrospect, yeah. Thanks. This is looking good, I'm using it now.

bhbraswell commented 4 years ago

I'm just a data scientist, but I approve this message.