-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix for box_size_um not included in robot_load_then_centre_plan. #763
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
tests/test_data/test_daq_configuration/lookup/BeamLine_Undulator_toGap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
####################### | ||
# # | ||
# 5.5mm CPMU 20/11/22 # | ||
# # | ||
####################### | ||
# Used to convert from energy to gap. Constructed from tables for 3rd, 5th and 7th harmonic. | ||
# It is important that at the point of change from one harmonic to another that there is | ||
# point for the same energy from both harmomics to prevent invalid interpolation. | ||
# run reloadLookupTables() when done | ||
Units eV mm | ||
5700 5.4606 | ||
5760 5.5 | ||
6000 5.681 | ||
6500 6.045 | ||
7000 6.404 | ||
7500 6.765 | ||
8000 7.124 | ||
8500 7.491 | ||
9000 7.872 | ||
9500 8.258 | ||
9700 8.424 | ||
9700 5.542 | ||
10000 5.675 | ||
10500 5.895 | ||
11000 6.113 | ||
11500 6.328 | ||
12000 6.545 | ||
12500 6.758 | ||
12700 6.83 | ||
13000 6.98 | ||
13443 7.168 | ||
13443 5.5 | ||
13500 5.517 | ||
14000 5.674 | ||
14500 5.831 | ||
15000 5.987 | ||
15500 6.139 | ||
16000 6.294 | ||
16500 6.447 | ||
17000 6.603 | ||
17320 6.697 | ||
17320 5.5 | ||
17500 5.552 | ||
18000 5.674 | ||
18500 5.794 | ||
19000 5.912 | ||
19500 6.037 | ||
20000 6.157 | ||
20500 6.277 | ||
20939 6.378 | ||
20939 5.5 | ||
21000 5.517 | ||
21500 5.577 | ||
22000 5.674 | ||
22500 5.773 | ||
23000 5.871 | ||
23500 5.97 | ||
24000 6.072 | ||
24500 6.167 | ||
25000 6.264 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,9 @@ def wait_for_run_engine_status( | |
|
||
def check_status_in_response(response_object, expected_result: Status): | ||
response_json = json.loads(response_object.data) | ||
assert response_json["status"] == expected_result.value | ||
assert response_json["status"] == expected_result.value, ( | ||
f"{response_json['status']} != {expected_result.value}: {response_json.get('message')}" | ||
) | ||
|
||
|
||
def test_start_gives_success(test_env: ClientAndRunEngine): | ||
|
@@ -290,14 +292,53 @@ def test_when_started_n_returnstatus_interrupted_bc_RE_aborted_thn_error_reptd( | |
assert response_json["exception_type"] == "Exception" | ||
|
||
|
||
def test_start_with_json_file_gives_success(test_env: ClientAndRunEngine): | ||
@pytest.mark.parametrize( | ||
"endpoint, test_file", | ||
[ | ||
[ | ||
START_ENDPOINT, | ||
"tests/test_data/parameter_json_files/good_test_parameters.json", | ||
], | ||
[ | ||
"/grid_detect_then_xray_centre/start", | ||
"tests/test_data/parameter_json_files/good_test_grid_with_edge_detect_parameters" | ||
".json", | ||
Comment on lines
+304
to
+305
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Having the |
||
], | ||
[ | ||
"/rotation_scan/start", | ||
"tests/test_data/parameter_json_files/good_test_rotation_scan_parameters" | ||
".json", | ||
], | ||
[ | ||
"/pin_tip_centre_then_xray_centre/start", | ||
"tests/test_data/parameter_json_files/good_test_pin_centre_then_xray_centre_parameters" | ||
".json", | ||
], | ||
[ | ||
"/robot_load_then_centre/start", | ||
"tests/test_data/parameter_json_files/good_test_robot_load_and_centre_params" | ||
".json", | ||
], | ||
[ | ||
"/multi_rotation_scan/start", | ||
"tests/test_data/parameter_json_files/good_test_multi_rotation_scan_parameters" | ||
".json", | ||
], | ||
[ | ||
"/load_centre_collect_full/start", | ||
"tests/test_data/parameter_json_files/good_test_load_centre_collect_params" | ||
".json", | ||
], | ||
], | ||
) | ||
def test_start_with_json_file_gives_success( | ||
test_env: ClientAndRunEngine, endpoint: str, test_file: str | ||
): | ||
test_env.mock_run_engine.RE_takes_time = False | ||
|
||
with open( | ||
"tests/test_data/parameter_json_files/good_test_parameters.json" | ||
) as test_params_file: | ||
with open(test_file) as test_params_file: | ||
test_params = test_params_file.read() | ||
response = test_env.client.put(START_ENDPOINT, data=test_params) | ||
response = test_env.client.put(endpoint, data=test_params) | ||
check_status_in_response(response, Status.SUCCESS) | ||
|
||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I normally prefer using the patch decorator, unless there's a specific reason you can't (which I don't think there is in this case?) as it leads to less indentation and I feel like keeps the test tidier but I get that's probably personal preference