Closed prjemian closed 4 years ago
No need to work in a branch since there is NO configuration now.
The beam line account already has a ~/.ipython
directory.
Install new configuration into ~/.ipython-bluesky
directory.
The starter script (for ~/bin/
) will be helpful to pull this all together.
Looking good:
(bluesky_2020_1) [sleepy /tmp] mkdir ~/.ipython-bluesky
(bluesky_2020_1) [sleepy /tmp] cd ~/.ipython-bluesky/
(bluesky_2020_1) [sleepy ~/.ipython-bluesky] git clone https://github.com/APS-29ID-IEX/ipython-29id ./
Cloning into '.'...
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 167 (delta 5), reused 39 (delta 4), pack-reused 124
Receiving objects: 100% (167/167), 57.86 KiB | 0 bytes/s, done.
Resolving deltas: 100% (64/64), done.
(bluesky_2020_1) [sleepy ~/.ipython-bluesky] ll
total 12
drwxrwxr-x 2 29iduser s29user 4096 Feb 20 17:03 bin
drwxrwxr-x 3 29iduser s29user 4096 Feb 20 17:03 profile_bluesky
-rw-rw-r-- 1 29iduser s29user 195 Feb 20 17:03 README
(bluesky_2020_1) [sleepy ~/.ipython-bluesky] cp bin/bluesky29ID.sh ~/bin/
(bluesky_2020_1) [sleepy ~/.ipython-bluesky] bluesky
bluesky-0MQ-proxy bluesky29ID.sh bluesky_snapshot bluesky_snapshot_viewer
(bluesky_2020_1) [sleepy ~/.ipython-bluesky] bluesky29ID.sh
Python 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:33:48)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.
IPython profile: bluesky
Activating auto-logging. Current session state plus future input saved.
Filename : /home/beams22/29IDUSER/.ipython-bluesky/.logs/ipython_console.log
Mode : rotate
Output logging : True
Raw input log : False
Timestamping : True
State : active
I Thu-17:04:25 - ############################################################ startup
I Thu-17:04:25 - logging started
I Thu-17:04:25 - logging level = 10
I Thu-17:04:25 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/collection.py
I Thu-17:04:25 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/mpl/console.py
I Thu-17:04:28 - bluesky framework
I Thu-17:04:28 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/check_python.py
I Thu-17:04:29 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/initialize.py
Loading metadata history from /home/beams/29IDUSER/.config/bluesky/bluesky_history.db
/home/beams/29IDUSER/.conda/envs/bluesky_2020_1/lib/python3.7/site-packages/bluesky/utils.py:831: UserWarning: bluesky.utils.install_qt_kicker is no longer necessary and has no effect. Please remove your use of it. It may be removed in a future release of bluesky.
warnings.warn("bluesky.utils.install_qt_kicker is no longer necessary and "
I Thu-17:04:35 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/user_dir.py
I Thu-17:04:35 - User code directory: /home/beams22/29IDUSER/.ipython-bluesky/bluesky_plans
I Thu-17:04:35 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/metadata.py
I Thu-17:04:36 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/callbacks.py
I Thu-17:04:37 - writing to SPEC file: /home/beams22/29IDUSER/.ipython-bluesky/20200220-170437.dat
I Thu-17:04:37 - >>>> Using default SPEC file name <<<<
I Thu-17:04:37 - file will be created when bluesky ends its next scan
I Thu-17:04:37 - to change SPEC file, use command: newSpecFile('title')
I Thu-17:04:37 - /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/devices/aps_source.py
In [1]:
Stunning error dump (which ultimately exited the bluesky session) when I tried to access the databroker component (mongodb database with archive of all previous data). Perhaps the server (groggy.xray.aps.anl.gov) has trouble? Is the mongodb server process running? The bluesky config file looks right.
We can still test the ophyd config.
Perhaps there is a different problem. Just tried a simple session. Autocomplete did not work. Another command crashed the session:
```
(bluesky_2020_1) [sleepy ~/.ipython-bluesky/profile_bluesky/startup] bluesky29ID.sh
Python 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:33:48)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.
IPython profile: bluesky
Activating auto-logging. Current session state plus future input saved.
Filename : /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/.logs/ipython_console.log
Mode : rotate
Output logging : True
Raw input log : False
Timestamping : True
State : active
I Thu-17:12:59 - ############################################################ startup
I Thu-17:12:59 - logging started
I Thu-17:12:59 - logging level = 10
I Thu-17:12:59 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/collection.py
I Thu-17:12:59 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/mpl/console.py
I Thu-17:12:59 - bluesky framework
I Thu-17:12:59 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/check_python.py
I Thu-17:13:00 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/initialize.py
Loading metadata history from /home/beams/29IDUSER/.config/bluesky/bluesky_history.db
/home/beams/29IDUSER/.conda/envs/bluesky_2020_1/lib/python3.7/site-packages/bluesky/utils.py:831: UserWarning: bluesky.utils.install_qt_kicker is no longer necessary and has no effect. Please remove your use of it. It may be removed in a future release of bluesky.
warnings.warn("bluesky.utils.install_qt_kicker is no longer necessary and "
I Thu-17:13:03 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/user_dir.py
I Thu-17:13:03 - User code directory: /home/beams/29IDUSER/.ipython-bluesky/bluesky_plans
I Thu-17:13:03 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/metadata.py
I Thu-17:13:03 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/framework/callbacks.py
I Thu-17:13:03 - writing to SPEC file: /home/beams22/29IDUSER/.ipython-bluesky/profile_bluesky/startup/20200220-171303.dat
I Thu-17:13:03 - >>>> Using default SPEC file name <<<<
I Thu-17:13:03 - file will be created when bluesky ends its next scan
I Thu-17:13:03 - to change SPEC file, use command: newSpecFile('title')
I Thu-17:13:03 - /home/beams/29IDUSER/.ipython-bluesky/profile_bluesky/startup/instrument/devices/aps_source.py
In [1]: show_ophyd_symbols()
Traceback (most recent call last):
File "/home/beams/29IDUSER/.conda/envs/bluesky_2020_1/lib/python3.7/site-packages/jedi/cache.py", line 109, in wrapper
return dct[key]
KeyError: ((), frozenset())
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/beams/29IDUSER/.conda/envs/bluesky_2020_1/lib/python3.7/site-packages/jedi/cache.py", line 109, in wrapper
return dct[key]
KeyError: ((), frozenset())
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/beams/29IDUSER/.conda/envs/bluesky_2020_1/bin/ipython", line 11, in
error starts with
In [1]: show_ophyd_symbols()
Traceback (most recent call last):
File "/home/beams/29IDUSER/.conda/envs/bluesky_2020_1/lib/python3.7/site-packages/jedi/cache.py", line 109, in wrapper
return dct[key]
KeyError: ((), frozenset())
The old JEDI problem for which we have a response commented out in the starter script (not everyone needs it).
Works now (even autocomplete):
In [1]: show_ophyd_symbols()
========= ================= ======== ========
name ophyd structure EPICS PV label(s)
========= ================= ======== ========
aps MyApsDevice
undulator MyUndulatorDevice ID29
========= ================= ======== ========
Out[1]: <pyRestTable.rest_table.Table at 0x7f42e8631690>
info from the APS:
In [2]: device_read2table(aps)
========================================== ===================== ==========================
name value timestamp
========================================== ===================== ==========================
aps_current 102.00075796160932 2020-02-20 17:19:59.157790
aps_lifetime 7.465751986709202 2020-02-20 17:19:55.729380
aps_aps_cycle 2020-1 2020-02-20 17:18:27.711560
aps_machine_status USER OPERATIONS 2020-02-18 08:00:01.295432
aps_operating_mode Delivered Beam 2020-02-18 08:00:05.405082
aps_shutter_permit PERMIT 2020-02-18 08:00:05.404582
aps_fill_number 6.0 2020-02-18 08:00:05.404143
aps_orbit_correction 0.0 2020-02-20 17:18:26.963514
aps_global_feedback On 2020-02-20 17:18:27.066070
aps_global_feedback_h On 2020-02-20 17:18:27.066070
aps_global_feedback_v On 2020-02-20 17:18:27.066070
aps_operator_messages_operators Weyer, Orne 2020-02-20 15:08:26.444129
aps_operator_messages_floor_coordinator Steve Bogdan (2-0101) 2020-02-20 07:54:45.824908
aps_operator_messages_fill_pattern 0+24x1 RHB 2020-02-15 05:58:52.657056
aps_operator_messages_last_problem_message 2020-02-20 06:00:47.855662
aps_operator_messages_last_trip_message 2020-02-20 06:00:52.240432
aps_operator_messages_message6 Top-Up is ongoing. 2020-02-20 06:00:43.838969
aps_operator_messages_message7 2020-02-16 05:11:10.273902
aps_operator_messages_message8 2020-02-16 05:11:06.707236
========================================== ===================== ==========================
Out[2]: <pyRestTable.rest_table.Table at 0x7f42e8623490>
Now, the listruns()
command produces an error that ends with:
ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
whic looks like the mongodb server is not running or does not accept our connection request.
Sent request to IT for assist with the mongo. We can take data if we divert to use the mongodb server otz.xray.aps.anl.gov in my office. 3-ID is doing that now. We can do that until groggy/mongodb gets working again.
Here's a picture of the default metadata we'll put into each scan's header (start document):
In [3]: print_RE_md()
RunEngine metadata dictionary:
======================== ==============================================
key value
======================== ==============================================
EPICS_BASE /APSshare/epics/extensions-base/3.14.12.3-ext1
EPICS_BASE_PVT /APSshare/epics/extensions-base/3.14.12.3-ext1
EPICS_CA_MAX_ARRAY_BYTES 800000
EPICS_EXTENSIONS /APSshare/epics/extensions
EPICS_HOST_ARCH linux-x86_64
beamline_id APS 29-ID
login_id 29iduser@sleepy.xray.aps.anl.gov
pid 21615
proposal_id testing
versions =========== ========
key value
=========== ========
apstools 1.2.1
bluesky 1.6.0rc4
databroker 0.13.3
epics 3.4.1
matplotlib 3.1.3
numpy 1.18.1
ophyd 1.4.0rc4
pyRestTable 2020.0.2
spec2nexus 2021.1.7
=========== ========
======================== ==============================================
Out[3]: <pyRestTable.rest_table.Table at 0x7f66edace810>
Here is the command to start a bluesky (ipython) session:
bluesky29ID.sh
Fixed the mongodb configuration for bluesky and now databroker works:
In [1]: listruns()
========= ======================= ======= ======= ========================================
short_uid date/time exit scan_id command
========= ======================= ======= ======= ========================================
79ceba7 2017-10-06 11:19:28.153 success 64 count(num=300, detectors=['mono_ener ...
71d0043 2017-10-06 11:14:28.820 success 63 count(num=5, detectors=['mono_energy'])
fd79b99 2017-10-06 11:14:20.372 success 62 count(num=5, detectors=['mono_energy'])
a396400 2017-10-06 11:09:45.654 success 61 count(num=5, detectors=['aps_current'])
427c253 2017-10-06 11:09:29.449 success 60 count(num=1, detectors=['aps_current'])
e53f9a9 2017-10-06 11:09:11.673 success 59 count(num=1, detectors=['ca1_b'])
6bd2a1e 2017-10-06 11:06:59.282 success 58 count(num=1, detectors=['ca1_b'])
96a5b2a 2017-10-06 11:04:10.819 success 57 count(num=300, detectors=['D4'])
afbddf4 2017-10-06 11:03:25.731 success 56 count(num=300, detectors=['ca1_b'])
5bdbbdd 2017-10-06 11:02:16.371 success 55 count(num=300, detectors=['aps_curre ...
94b111d 2017-10-06 10:49:41.080 success 58 count(num=300, detectors=['aps_curre ...
f79a7f4 2017-10-06 10:48:21.996 success 57 count(num=300, detectors=['ca1_b'])
69dff04 2017-10-06 10:47:00.398 success 56 count(num=300, detectors=['ca1_b'])
c621155 2017-10-06 10:41:52.390 success 55 count(num=300, detectors=['D3', 'D4'])
07b9d29 2017-08-11 20:18:50.471 60 count(detectors=['EAV', 'TEY_C'], nu ...
0d1bc67 2017-08-11 16:06:32.676 success 59 count(detectors=['EAV', 'TEY_C'], nu ...
c681c32 2017-08-11 15:52:53.730 success 58 count(detectors=['EAV', 'TEY_C'], nu ...
8d0c6d9 2017-08-11 15:09:26.610 success 57 count(detectors=['EAV', 'TEY_C'], nu ...
1c90629 2017-08-11 15:03:52.756 success 56 count(detectors=['EAV', 'TEY_C'], nu ...
8c2217e 2017-08-11 15:00:47.456 success 55 count(detectors=['EAV', 'TEY_C'], nu ...
========= ======================= ======= ======= ========================================
Out[1]: <pyRestTable.rest_table.Table at 0x7f6909465a90>
Time to restart bluesky operations at 29-ID. There is a new recommendation to layout the .ipython directory (see 3-ID and 8-ID-I XPCS). this should be easier to understand and maintain.