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

meet the API expected by the RunEngine #8

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

prjemian
Copy link
Collaborator

close #7

@prjemian prjemian added the bug Something isn't working label Oct 30, 2024
@prjemian prjemian requested a review from MDecarabas October 30, 2024 23:46
@prjemian prjemian self-assigned this Oct 30, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11603431179

Details

  • 1 of 3 (33.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 83.468%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/instrument/utils/controls_setup.py 1 3 33.33%
Totals Coverage Status
Change from base Build 11578561732: -0.2%
Covered Lines: 414
Relevant Lines: 496

💛 - Coveralls

@prjemian
Copy link
Collaborator Author

Locally with these changes, startup is successful, scan_id is as expected, and sim_rel_scan_plan() works, demonstrating the PV is connected.

(bs_model_env) prjemian@arf:~/model$ ipython -i -c "from instrument.startup import *"
Python 3.11.10 | packaged by conda-forge | (main, Oct 16 2024, 01:27:36) [GCC 13.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.
I Wed-18:37:57.418: **************************************** Bluesky Startup Initialized

Below are the IPython logging settings for your session.
These settings have no impact on your experiment.

Activating auto-logging. Current session state plus future input saved.
Filename       : /home/prjemian/model/.logs/ipython_log.py
Mode           : rotate
Output logging : True
Raw input log  : False
Timestamping   : True
State          : active
Exception reporting mode: Minimal

End of IPython settings

W Wed-18:37:57.842: APS DM setup file does not exist: '/home/dm/etc/dm.setup.sh'
I Wed-18:37:58.903: Databroker catalog: training
I Wed-18:37:59.024: RunEngine metadata saved in directory: /home/prjemian/.config/Bluesky_RunEngine_md
I Wed-18:37:59.027: using ophyd control layer: 'pyepics'
I Wed-18:37:59.027: Using EPICS PV 'gp:gp:int20' for RunEngine 'scan_id'
/home/prjemian/model/src/instrument/startup.py
I Wed-18:37:59.114: SPEC data file: /home/prjemian/model/20241030-183759.dat

In [1]: RE.md["scan_id"]
Out[1]: 62

In [2]: RE(sim_rel_scan_plan(num=17))
sim_rel_scan_plan(): sim_motor.position=0.
sim_rel_scan_plan(): sim_det.read()=OrderedDict([('noisy_det', {'value': np.float64(0.9594472813352338), 'timestamp': 1730331478.8979254})]).
sim_rel_scan_plan(): sim_det.read_configuration()=OrderedDict([('noisy_det_Imax', {'value': 10000, 'timestamp': 1730331494.017334}), ('noisy_det_center', {'value': 0, 'timestamp': 1730331494.0176873}), ('noisy_det_sigma', {'value': 1, 'timestamp': 1730331494.0183764}), ('noisy_det_noise', {'value': 'uniform', 'timestamp': 1730331494.0187588}), ('noisy_det_noise_multiplier', {'value': 0.1, 'timestamp': 1730331478.897735})]).
sim_rel_scan_plan(): sim_det.noise._enum_strs=('none', 'poisson', 'uniform').


Transient Scan ID: 63     Time: 2024-10-30 18:38:14
Persistent Unique Scan ID: 'f08fd395-655b-4d69-a205-66ed70905226'
New stream: 'primary'
+-----------+------------+------------+------------+
|   seq_num |       time |      motor |  noisy_det |
+-----------+------------+------------+------------+
|         1 | 18:38:14.0 |     -2.500 |    439.463 |
|         2 | 18:38:14.3 |     -2.188 |    913.916 |
|         3 | 18:38:14.3 |     -1.875 |   1724.127 |
|         4 | 18:38:14.3 |     -1.562 |   2950.229 |
|         5 | 18:38:14.3 |     -1.250 |   4578.351 |
|         6 | 18:38:14.3 |     -0.938 |   6443.899 |
|         7 | 18:38:14.3 |     -0.625 |   8225.869 |
|         8 | 18:38:14.4 |     -0.312 |   9523.393 |
|         9 | 18:38:14.4 |      0.000 |   9999.949 |
|        10 | 18:38:14.4 |      0.312 |   9523.489 |
|        11 | 18:38:14.4 |      0.625 |   8225.699 |
|        12 | 18:38:14.4 |      0.938 |   6443.862 |
|        13 | 18:38:14.5 |      1.250 |   4578.367 |
|        14 | 18:38:14.5 |      1.562 |   2950.295 |
|        15 | 18:38:14.5 |      1.875 |   1724.304 |
|        16 | 18:38:14.5 |      2.188 |    913.994 |
|        17 | 18:38:14.5 |      2.500 |    439.273 |
+-----------+------------+------------+------------+
generator rel_scan ['f08fd395'] (scan num: 63)



Out[2]: ('f08fd395-655b-4d69-a205-66ed70905226',)

In [3]: !caget gp:gp:int20
gp:gp:int20                    63

@prjemian prjemian merged commit 5f727ce into main Oct 31, 2024
7 checks passed
@prjemian prjemian deleted the 7-TypeError-SCAN_ID_PV branch October 31, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: when SCAN_ID_PV is configured
3 participants