PALab / place

Python package for laboratory automation, control, and experimentation
GNU Lesser General Public License v3.0
31 stars 6 forks source link

First steps in supporting Python 3 #1

Closed paul-freeman closed 7 years ago

paul-freeman commented 7 years ago

Hi Jami (PALab people, too),

I'm giving you a pull request so you can see how it works and start looking at some of the changes I've made. We can meet up if you want me to go over any of it.

I think you'd be the most interested in the DS345 changes I made. For one, it's now a subclass of Serial, instead of being a class of it's own containing just a Serial object. It's a small difference, but it allows using just 'self' instead of 'self.fgen' everywhere. Also, it better describes what's going on - a function generator is a subclass of all serial devices.

Anyway, we can discuss anything you want. Just let me know.

-Paul

jamishepherd commented 7 years ago

Hi Paul,

Thanks for the changes!

The DS345 change is slick, and we should also be able to do the same for polytec/vibrometer.py and quanta_ray/QRay_driver.py correct?

Jami

On Fri, Nov 18, 2016 at 12:58 PM Paul Freeman notifications@github.com wrote:

Hi Jami (PALab people, too),

I'm giving you a pull request so you can see how it works and start looking at some of the changes I've made. We can meet up if you want me to go over any of it.

I think you'd be the most interested in the DS345 changes I made. For one, it's now a subclass of Serial, instead of being a class of it's own containing just a Serial object. It's a small difference, but it allows using just 'self' instead of 'self.fgen' everywhere. Also, it better describes what's going on - a function generator is a subclass of all serial devices.

Anyway, we can discuss anything you want. Just let me know.

-Paul

You can view, comment on, or merge this pull request online at:

https://github.com/PALab/PLACE/pull/1 Commit Summary

  • updated print statements for Python 3
  • added classifiers to indicate support for Python 2.7 and 3.5; also cleanup
  • updated to match source
  • various Python 3 updates
  • fixed print statement and removed dos line endings
  • remove .pyc files and add .gitignore
  • ignoring Python .coverage files
  • sample unittest file
  • removed sudo requirement
  • removed sudo requirement; made DS345 a subclass of Serial; some code cleanup; some Python 3 updates

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PALab/PLACE/pull/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AGtwoAscgB0hZE2eVhmY04NzeSYuPDJlks5q_OoZgaJpZM4K19tR .

paul-freeman commented 7 years ago

Yeah. There is probably a lot we could do. For example, openConnection could be an overridden version of the open() method in Serial. That would allow you to just call:

fgen = DS345()
fgen.open()

Next time you are running a scan, we should try it with Python 3 and see how much stuff breaks. I can clean up code as I go.

jamishepherd commented 7 years ago

Sounds good. I will probably run a scan next week.

On Fri, Nov 18, 2016 at 2:01 PM Paul Freeman notifications@github.com wrote:

Yeah. There is probably a lot we could do. For example, openConnection could be an overridden version of the open() method in Serial. That would allow you to just call:

fgen = DS345() fgen.open()

Next time you are running a scan, we should try it with Python 3 and see how much stuff breaks. I can clean up code as I go.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/PALab/PLACE/pull/1#issuecomment-261418742, or mute the thread https://github.com/notifications/unsubscribe-auth/AGtwoN87oduRuRG-3Cl5VqHCBJFe4PAQks5q_PjGgaJpZM4K19tR .