Skip to content

fix for _load_psf_blacklist, and some python 3 compatibility changes - #77

Open
NiallMac wants to merge 2 commits into
esheldon:masterfrom
NiallMac:v0.9.6-imsims
Open

fix for _load_psf_blacklist, and some python 3 compatibility changes#77
NiallMac wants to merge 2 commits into
esheldon:masterfrom
NiallMac:v0.9.6-imsims

Conversation

@NiallMac

@NiallMac NiallMac commented Nov 6, 2018

Copy link
Copy Markdown

The main point of this PR was to fix the fact that MEDSImageIO does not have a _load_psf_blacklist method, yet it is called in __init__. So I added a method which just sets a self.psf_blacklist={}. I happened to be testing this with python 3, and there were some compatibility issues that I also added fixes for.

@beckermr beckermr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor thing.

Comment thread ngmixer/files.py
fnames = []
for band in bands:
fname=desmeds.files.get_meds_file(medsconf, tile_id, band)
fname = os.path.join(dir, fname)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this line?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a bug, it was probably fixed in a later update

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. We should backport the fix maybe or just shipit. I don’t care.

Comment thread ngmixer/ngmixing.py
from .util import UtterFailure, seed_numpy

import six
from six.moves import xrange, cPickle

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSSSSIIIIIIIXXXXXXX @esheldon ;p

@beckermr beckermr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good to merge this. @esheldon any comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants