xpdAcq / xpdSim

simulator objects for bluesky, ophyd
http://xpdacq.github.io/xpdSim/
Other
0 stars 5 forks source link

remove mock bluesky #8

Closed tacaswell closed 7 years ago

tacaswell commented 8 years ago

This will cause packaging nightmares, please do not do this.

chiahaoliu commented 8 years ago

I see. Simon came out this idea for testing our xpdacq package. If we are about to release our code to general users so that they can test/simulate beamtime workflow at XPD, we want call exactly the same codes in xpdacq package (for developing purpose, we don't want to have two versions of codes, one for real experiment, one for simulating). They have to do from bluesky.scans import Count and something like that. So in this case, what would you recommend to do? Thanks

tacaswell commented 8 years ago

Actually import bluesky or use the mock module

On Thu, Feb 11, 2016, 16:42 Timothy Liu notifications@github.com wrote:

I see. Simon came out this idea for testing our xpdacq package. If we are about to release our code to general users so that they can test/simulate beamtime workflow at XPD, we want call exactly the same codes in xpdacq package (for developing purpose, we don't want to have two versions of codes, one for real experiment, one for simulating). They have to do 'from bluesky.scans import Count' and something like that. So in this case, what would you recommend to do? Thanks

— Reply to this email directly or view it on GitHub https://github.com/xpdAcq/xpdSim/issues/8#issuecomment-183069495.

chiahaoliu commented 8 years ago

A real bluesky is obviously the best solution but it is also the most complicated and heavy-weighted one, given my little knowledge to python. I still have problem in even get it running, but I will keep trying for sure.

Can you talk more about mock module?

tacaswell commented 8 years ago

https://docs.python.org/3/library/unittest.mock.html is in the standard library.

I disagree that sorting out how to install the dependancies for bluesky is harder than understanding it's API well enough to stub out it's functionality ;)

On Thu, Feb 11, 2016 at 5:07 PM Timothy Liu notifications@github.com wrote:

A real bluesky is obviously the best solution but it is also the most complicated and heavy-weighted one, given my little knowledge to python. I still have problem in even get it running, but I will keep trying for sure.

Can you talk more about mock module?

— Reply to this email directly or view it on GitHub https://github.com/xpdAcq/xpdSim/issues/8#issuecomment-183079749.

chiahaoliu commented 8 years ago

:+1: but private tutor needed :p

sbillinge commented 8 years ago

Hi All,

I want to package xpdSim for users so that they can download and install on their windows machine, pretty much double-click something and have it work out of the box. That could be with bluesky for real, it shouldn't be too hard with conda. Our current approach may be a mistake, but we just needed to trick the xpdacq functions to load without an exception...they don't have to return any functionality....at least for now. Later on, we may want different "mock" functionality where prun(sampleObj,scanObj) stores a fake event somewhere so that an.get(it) can plot that thing....but that is for much later, and that is actually not the behavior of real bluesky.

I am not familiar with mock, but it looks as if it might be just what we need....though it will then also become a dependency for the version of xpdSim that we distribute....

Anyway, I am totally open to discussing the best way to proceed here, but for now I just need it working on my machine so that I can load and test our bug-fixes....

Awesome guys, thanks for the engagement and help! S

On Thu, Feb 11, 2016 at 5:58 PM, Timothy Liu notifications@github.com wrote:

[image: :+1:] but private tutor needed :p

— Reply to this email directly or view it on GitHub https://github.com/xpdAcq/xpdSim/issues/8#issuecomment-183092764.


Prof. Simon Billinge

Applied Physics & Applied Mathematics Columbia University 500 West 120th Street Room 200 Mudd, MC 4701 New York, NY 10027 Tel: (212)-854-2918 (o) 851-7428 (lab)

Condensed Matter Physics and Materials Science Dept. Brookhaven National Laboratory P.O. Box 5000 Upton, NY 11973-5000 (631)-344-5661

email: sb2896 at columbia dot edu home: http://thebillingegroup.com

tacaswell commented 8 years ago

Mock is (as of 3.3) part of the standard library.

On Thu, Feb 11, 2016, 18:09 Simon Billinge notifications@github.com wrote:

Hi All,

I want to package xpdSim for users so that they can download and install on their windows machine, pretty much double-click something and have it work out of the box. That could be with bluesky for real, it shouldn't be too hard with conda. Our current approach may be a mistake, but we just needed to trick the xpdacq functions to load without an exception...they don't have to return any functionality....at least for now. Later on, we may want different "mock" functionality where prun(sampleObj,scanObj) stores a fake event somewhere so that an.get(it) can plot that thing....but that is for much later, and that is actually not the behavior of real bluesky.

I am not familiar with mock, but it looks as if it might be just what we need....though it will then also become a dependency for the version of xpdSim that we distribute....

Anyway, I am totally open to discussing the best way to proceed here, but for now I just need it working on my machine so that I can load and test our bug-fixes....

Awesome guys, thanks for the engagement and help! S

On Thu, Feb 11, 2016 at 5:58 PM, Timothy Liu notifications@github.com wrote:

[image: :+1:] but private tutor needed :p

— Reply to this email directly or view it on GitHub https://github.com/xpdAcq/xpdSim/issues/8#issuecomment-183092764.


Prof. Simon Billinge

Applied Physics & Applied Mathematics Columbia University 500 West 120th Street Room 200 Mudd, MC 4701 New York, NY 10027 Tel: (212)-854-2918 (o) 851-7428 (lab)

Condensed Matter Physics and Materials Science Dept. Brookhaven National Laboratory P.O. Box 5000 Upton, NY 11973-5000 (631)-344-5661

email: sb2896 at columbia dot edu home: http://thebillingegroup.com

— Reply to this email directly or view it on GitHub https://github.com/xpdAcq/xpdSim/issues/8#issuecomment-183095198.

chiahaoliu commented 8 years ago

Hey @tacaswell , I just managed to install bluesky, instantiate my own run engine, run a Count scan with my fake ophyd object with no error ! Plus it is reproducible in several fresh conda environments! This thing never worked for the past week, but I guess miracle always happens! Also thanks @danielballan for awesome design!

For callback like LiveTable, I think it is better to make a complete fake object, since we don't want to touch filestore. Is that right?

CJ-Wright commented 7 years ago

Can we close?

chiahaoliu commented 7 years ago

close