Skip to content
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

Update old syntax #8

Merged
merged 4 commits into from
Feb 23, 2021
Merged

Update old syntax #8

merged 4 commits into from
Feb 23, 2021

Conversation

bamford
Copy link
Contributor

@bamford bamford commented Feb 16, 2021

Hi Ken!

I've got some students using smpy to generate SEDs for simulated galaxies. It seems to be working fine, but they encountered some issues when the code couldn't find required files. The main thing was some outdated Exception syntax. Anyway, I took a look and have ended up having a go at minimally modernising the code:

  • I used 2to3 to fixed old Python 2 syntax (the Exception thing and a few print statements)
  • The code was printing some repeated numpy and h5py deprecation warnings, so I fixed those
  • For the hell of it I applied pyupgrade --py3-plus, which mostly tidied up some .format statements and removed use of xrange.
  • I added an error message if no filter files can be found.

So, here's my version in case you want to merge the changes in to your repo.

@dunkenj
Copy link
Owner

dunkenj commented Feb 17, 2021

Hi Steven,
Amazing, thanks. I should be able to fold everything in next week.

@dunkenj dunkenj merged commit 2c7ad73 into dunkenj:master Feb 23, 2021
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.

2 participants