-
Notifications
You must be signed in to change notification settings - Fork 12
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
Pre 1.0 maintenance PR #19
Conversation
Remove unneeded/untested code, add change log, new requirements enumeration, remove empty setup.cfg.
setup.py
Outdated
packages=find_packages(exclude=["ez_setup", "examples", "tests"]), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=["click", "numpy", "rasterio>=1.0rc4"], |
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.
the requirements file and install_requires
have different purposes. I'm pulling the library requirements back in here.
def __exit__(self, ext_t, ext_v, trace): | ||
if ext_t: | ||
traceback.print_exc() |
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 was untested code and I don't see how it would be used in production.
try: | ||
srcs = [rio.open(i) for i in inpaths] | ||
except: | ||
return |
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 silently swallows all exceptions and I think it's better to delete it.
riomucho/__init__.py
Outdated
return work_func(srcs, window, ij, global_args), window | ||
except Exception as e: | ||
traceback.print_exc() | ||
raise e |
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.
Hmm, now I get why this code was here. Looking for a better way...
I found the better way: a decorator that wraps a child process's exception and carries the traceback to the parent. The only problem with it is that there seems to be a Python 3.4 specific bug causing the processing pool to hang: https://travis-ci.org/mapbox/rio-mucho/jobs/402774581#L549. |
rasterio | ||
click==6.7 | ||
numpy==1.14.5 | ||
rasterio==1.0rc5 |
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.
To make our Travis build requirements stable and reproducible.
riomucho/__init__.py
Outdated
|
||
@job |
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.
The job
decorator wraps up tracebacks that happen in child processes and reraises them, which is better than printing them because they can be caught and inspected in Python.
@@ -1,95 +1,146 @@ | |||
"""TODO |
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.
Docstrings are a todo.
Nice side effect: builds finish in <3 mins now. |
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.
Looks good so far -- we should try this version out in a riomucho-using library (pxm alpha, rio color maybe)
riomucho/__init__.py
Outdated
import click | ||
import numpy as np |
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 don't even think we are using numpy in __init__.py
, are we?
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.
(Just in scripts/riomucho_utils.py)
riomucho/__init__.py
Outdated
return wrapper | ||
|
||
|
||
def main_worker(inpaths, g_work_func, g_args): | ||
"""TODO""" | ||
global work_func |
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 global isn't needed anymore, we now wrap the user function up in another class that gets passed to imap_unordered
.
Getting riomucho to a stable 1.0.0!