fix for _load_psf_blacklist, and some python 3 compatibility changes - #77
Open
NiallMac wants to merge 2 commits into
Open
fix for _load_psf_blacklist, and some python 3 compatibility changes#77NiallMac wants to merge 2 commits into
NiallMac wants to merge 2 commits into
Conversation
beckermr
requested changes
Nov 6, 2018
| fnames = [] | ||
| for band in bands: | ||
| fname=desmeds.files.get_meds_file(medsconf, tile_id, band) | ||
| fname = os.path.join(dir, fname) |
Collaborator
There was a problem hiding this comment.
Why did you remove this line?
Author
There was a problem hiding this comment.
Sorry, should have commented - it causes an error in python 3:
0: File "/global/project/projectdirs/des/maccrann/py3/lib/python3.6/site-packages/ngmixer/files.py", line 102, in get_meds_files
0: fname = os.path.join(dir, fname)
0: File "/global/project/projectdirs/des/maccrann/py3/lib/python3.6/posixpath.py", line 78, in join
0: a = os.fspath(a)
0: TypeError: expected str, bytes or os.PathLike object, not builtin_function_or_method
and anyway I assumed it was a bug since dir is not defined?
Owner
There was a problem hiding this comment.
it is a bug, it was probably fixed in a later update
Collaborator
There was a problem hiding this comment.
Hmmm. We should backport the fix maybe or just shipit. I don’t care.
beckermr
reviewed
Nov 9, 2018
| from .util import UtterFailure, seed_numpy | ||
|
|
||
| import six | ||
| from six.moves import xrange, cPickle |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main point of this PR was to fix the fact that
MEDSImageIOdoes not have a_load_psf_blacklistmethod, yet it is called in__init__. So I added a method which just sets aself.psf_blacklist={}. I happened to be testing this with python 3, and there were some compatibility issues that I also added fixes for.