Created
July 31, 2019 15:32
-
-
Save metasim/6c487e5cc9f85d3821ef738fa445aa0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def set_dims(parts): | |
| assert(len(parts) is 2, "Expected dimensions specification to have exactly two components") | |
| assert(all([isinstance(p, int) and p > 0 for p in parts]), | |
| "Expected all components in dimensions to be positive integers") | |
| options.update({ | |
| "imageWidth": parts[0], | |
| "imageHeight": parts[1] | |
| }) | |
| if raster_dimensions is not None: | |
| if isinstance(raster_dimensions, tuple): | |
| set_dims(raster_dimensions) | |
| elif isinstance(raster_dimensions, str): | |
| p = list(map(lambda s: int(s), raster_dimensions.split(','))) | |
| set_dims(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IDK but maybe this seems correct
And as I recall there is some interesting things like if i say
a=2andb=2thena is bis true because both objects will point ot the same underlying object. I think.