Conversation
changed image pyramid interface to be more straightforward, and changed tests where necessary bumped version to indicate backward compatability break wip fixed auto sorting
fixed s3 bucket read added new requirements removed auto-import of image_open making urlparse python3 compatible fixing python3 imports more another import fix
Codecov Report
@@ Coverage Diff @@
## develop #109 +/- ##
===========================================
+ Coverage 93.91% 94.96% +1.04%
===========================================
Files 16 17 +1
Lines 1694 2047 +353
===========================================
+ Hits 1591 1944 +353
Misses 103 103
Continue to review full report at Codecov.
|
| return "{}".format(level) | ||
|
|
||
| def to_dict(self): | ||
| return {k: v.to_dict() for k, v in self.items()} |
There was a problem hiding this comment.
Do we want these to return empty mipmaplevels e.g.
{
"0": {},
"1": {
"imageUrl": "file:///path/to/img",
"maskUrl": null
},
}There was a problem hiding this comment.
hmm... I don't think so. Is there a reason we should?
renderapi/image_pyramid.py
Outdated
| def to_dict(self): | ||
| return {k: v.to_dict() for k, v in self.items()} | ||
|
|
||
| @staticmethod |
There was a problem hiding this comment.
Any reason not to make this a classmethod? Might be tempted to subclass this at some point.
There was a problem hiding this comment.
no reason. did you mean to_dict or line 157?
There was a problem hiding this comment.
I meant the from_dict method so that a subclass will return an instance of itself rather than ImagePyramid.
renderapi/image_pyramid.py
Outdated
| """ | ||
|
|
||
| def __init__(self, level, imageUrl=None, maskUrl=None): | ||
| logger.warning( |
There was a problem hiding this comment.
should we use warnings.DeprecationWarning for this?
| d.update({'maskUrl': self.maskUrl}) | ||
| return d | ||
|
|
||
| def __getitem__(self, key): |
There was a problem hiding this comment.
should this also support assignment with a setitem? The current implementation does not support
ip[0]['imageUrl'] = "file:///path/to/image"There was a problem hiding this comment.
oh i don't see why not... might actually make it more backwards compatible.
I'd like to reopen this discussion about a better way to handle the image pyramid interface.