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

remove mock bluesky #8

Closed
tacaswell opened this issue Feb 11, 2016 · 10 comments
Closed

remove mock bluesky #8

tacaswell opened this issue Feb 11, 2016 · 10 comments

Comments

@tacaswell
Copy link

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

@chiahaoliu
Copy link
Collaborator

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
Copy link
Author

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
#8 (comment).

@chiahaoliu
Copy link
Collaborator

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
Copy link
Author


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
#8 (comment).

@chiahaoliu
Copy link
Collaborator

👍 but private tutor needed :p

@sbillinge
Copy link
Member

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: 👍] but private tutor needed :p


Reply to this email directly or view it on GitHub
#8 (comment).


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
Copy link
Author

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: 👍] but private tutor needed :p


Reply to this email directly or view it on GitHub
#8 (comment).


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
#8 (comment).

@chiahaoliu
Copy link
Collaborator

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
Copy link
Member

Can we close?

@chiahaoliu
Copy link
Collaborator

close

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

No branches or pull requests

4 participants