Minor fixes to httplib/OpenAPI
Some checks failed
Build Packages / build:rpm (rocky8_nocuda) (push) Failing after 7m17s
Build Packages / build:rpm (rocky9_nocuda) (push) Failing after 8m28s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Failing after 8m27s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Failing after 8m30s
Build Packages / Build documentation (push) Successful in 35s
Build Packages / Generate python client (push) Successful in 43s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky9_sls9) (push) Failing after 9m30s
Build Packages / build:rpm (rocky8) (push) Failing after 10m12s
Build Packages / build:rpm (rocky8_sls9) (push) Failing after 10m17s
Build Packages / build:rpm (rocky9) (push) Failing after 10m14s
Build Packages / build:rpm (ubuntu2404) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2204) (push) Has been cancelled
Build Packages / Unit tests (push) Has been cancelled
Some checks failed
Build Packages / build:rpm (rocky8_nocuda) (push) Failing after 7m17s
Build Packages / build:rpm (rocky9_nocuda) (push) Failing after 8m28s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Failing after 8m27s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Failing after 8m30s
Build Packages / Build documentation (push) Successful in 35s
Build Packages / Generate python client (push) Successful in 43s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky9_sls9) (push) Failing after 9m30s
Build Packages / build:rpm (rocky8) (push) Failing after 10m12s
Build Packages / build:rpm (rocky8_sls9) (push) Failing after 10m17s
Build Packages / build:rpm (rocky9) (push) Failing after 10m14s
Build Packages / build:rpm (ubuntu2404) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2204) (push) Has been cancelled
Build Packages / Unit tests (push) Has been cancelled
This commit is contained in:
@@ -310,7 +310,6 @@ void JFJochBrokerHttp::register_routes(httplib::Server &server) {
|
||||
try {
|
||||
preview_plot_get(parse_query_string(req, "type"),
|
||||
parse_query_value<int32_t>(req, "binning"),
|
||||
parse_query_value<bool>(req, "compression"),
|
||||
parse_query_value<float>(req, "fill"),
|
||||
parse_query_value<bool>(req, "experimental_coord"),
|
||||
parse_query_string(req, "azint_unit"),
|
||||
@@ -328,7 +327,7 @@ void JFJochBrokerHttp::register_routes(httplib::Server &server) {
|
||||
|
||||
server.Get("/statistics", [this](const httplib::Request &req, httplib::Response &res) {
|
||||
try {
|
||||
statistics_get(parse_query_value<bool>(req, "compression"), res);
|
||||
statistics_get(res);
|
||||
} catch (const std::exception &e) {
|
||||
auto [c, s] = handleOperationException(e);
|
||||
send_plain(res, c, s);
|
||||
@@ -462,6 +461,7 @@ void JFJochBrokerHttp::statistics_calibration_get(httplib::Response &response) {
|
||||
nlohmann::json j;
|
||||
for (const auto &d: Convert(state_machine.GetCalibrationStatistics()))
|
||||
j.push_back(d);
|
||||
logger.Info("Calibration statistics: {}", j.dump());
|
||||
response.set_content(j.dump(), "application/json");
|
||||
response.status = 200;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void JFJochBrokerHttp::fpga_status_get(httplib::Response &response) {
|
||||
response.status = 200;
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::statistics_get(const std::optional<bool> &compression, httplib::Response &response) {
|
||||
void JFJochBrokerHttp::statistics_get(httplib::Response &response) {
|
||||
Jfjoch_statistics statistics;
|
||||
|
||||
auto data_collection_statistics = state_machine.GetMeasurementStatistics();
|
||||
@@ -774,7 +774,7 @@ void JFJochBrokerHttp::config_indexing_put(const Indexing_settings &indexingSett
|
||||
void JFJochBrokerHttp::result_scan_get(httplib::Response &response) {
|
||||
auto ret = state_machine.GetScanResult();
|
||||
if (ret.has_value())
|
||||
ProcessOutput(Convert(ret.value()), response, true);
|
||||
ProcessOutput(Convert(ret.value()), response);
|
||||
else
|
||||
response.status = 404;
|
||||
}
|
||||
@@ -832,7 +832,6 @@ void JFJochBrokerHttp::preview_plot_bin_get(const std::optional<std::string> &ty
|
||||
|
||||
void JFJochBrokerHttp::preview_plot_get(const std::optional<std::string> &type,
|
||||
const std::optional<int32_t> &binning,
|
||||
const std::optional<bool> &compression,
|
||||
const std::optional<float> &fill,
|
||||
const std::optional<bool> &experimentalCoord,
|
||||
const std::optional<std::string> &azintUnit,
|
||||
@@ -863,9 +862,8 @@ void JFJochBrokerHttp::preview_plot_get(const std::optional<std::string> &type,
|
||||
}
|
||||
req.binning = binning.value();
|
||||
}
|
||||
|
||||
auto plot = state_machine.GetPlots(req);
|
||||
ProcessOutput(Convert(plot), response, compression.value_or(false));
|
||||
ProcessOutput(Convert(plot), response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_roi_get(httplib::Response &response) {
|
||||
|
||||
@@ -50,7 +50,7 @@ class JFJochBrokerHttp {
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ProcessOutput(const T &output, httplib::Response &response, bool compression = false) {
|
||||
void ProcessOutput(const T &output, httplib::Response &response) {
|
||||
std::stringstream s;
|
||||
if (!output.validate(s)) {
|
||||
logger.Error(s.str());
|
||||
@@ -60,8 +60,6 @@ class JFJochBrokerHttp {
|
||||
}
|
||||
|
||||
nlohmann::json j = output;
|
||||
if (compression)
|
||||
response.set_header("Content-Encoding", "deflate");
|
||||
response.status = 200;
|
||||
response.set_content(j.dump(), "application/json");
|
||||
}
|
||||
@@ -113,7 +111,7 @@ class JFJochBrokerHttp {
|
||||
|
||||
void fpga_status_get(httplib::Response &response);
|
||||
|
||||
void statistics_get(const std::optional<bool> &compression, httplib::Response &response);
|
||||
void statistics_get(httplib::Response &response);
|
||||
|
||||
void config_zeromq_preview_get(httplib::Response &response);
|
||||
void config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings,
|
||||
@@ -151,7 +149,7 @@ class JFJochBrokerHttp {
|
||||
void preview_plot_bin_get(const std::optional<std::string> &type, const std::optional<std::string> &roi,
|
||||
httplib::Response &response);
|
||||
void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
|
||||
const std::optional<bool> &compression, const std::optional<float> &fill,
|
||||
const std::optional<float> &fill,
|
||||
const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit,
|
||||
httplib::Response &response);
|
||||
|
||||
|
||||
@@ -42,14 +42,6 @@ components:
|
||||
default: 1
|
||||
type: integer
|
||||
description: Binning of frames for the plot (0 = default binning)
|
||||
compression:
|
||||
in: query
|
||||
name: compression
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Enable DEFLATE compression of output data.
|
||||
experimental_coord:
|
||||
in: query
|
||||
name: experimental_coord
|
||||
@@ -3082,8 +3074,6 @@ paths:
|
||||
/statistics:
|
||||
get:
|
||||
summary: Get general statistics
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/compression'
|
||||
responses:
|
||||
"200":
|
||||
description: Everything OK
|
||||
@@ -3258,7 +3248,6 @@ paths:
|
||||
summary: Generate 1D plot from Jungfraujoch
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/binning"
|
||||
- $ref: "#/components/parameters/compression"
|
||||
- $ref: "#/components/parameters/plot_type"
|
||||
- $ref: "#/components/parameters/fill_value"
|
||||
- $ref: "#/components/parameters/experimental_coord"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3348,7 +3348,7 @@ No authorization required
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **preview_plot_get**
|
||||
> Plots preview_plot_get(type, binning=binning, compression=compression, fill=fill, experimental_coord=experimental_coord, azint_unit=azint_unit)
|
||||
> Plots preview_plot_get(type, binning=binning, fill=fill, experimental_coord=experimental_coord, azint_unit=azint_unit)
|
||||
|
||||
Generate 1D plot from Jungfraujoch
|
||||
|
||||
@@ -3374,14 +3374,13 @@ with jfjoch_client.ApiClient(configuration) as api_client:
|
||||
api_instance = jfjoch_client.DefaultApi(api_client)
|
||||
type = 'type_example' # str | Type of requested plot
|
||||
binning = 1 # int | Binning of frames for the plot (0 = default binning) (optional) (default to 1)
|
||||
compression = False # bool | Enable DEFLATE compression of output data. (optional) (default to False)
|
||||
fill = 3.4 # float | Fill value for elements that were missed during data collection (optional)
|
||||
experimental_coord = False # bool | If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored (optional) (default to False)
|
||||
azint_unit = Q_recipA # str | Unit used for azim int. (optional) (default to Q_recipA)
|
||||
|
||||
try:
|
||||
# Generate 1D plot from Jungfraujoch
|
||||
api_response = api_instance.preview_plot_get(type, binning=binning, compression=compression, fill=fill, experimental_coord=experimental_coord, azint_unit=azint_unit)
|
||||
api_response = api_instance.preview_plot_get(type, binning=binning, fill=fill, experimental_coord=experimental_coord, azint_unit=azint_unit)
|
||||
print("The response of DefaultApi->preview_plot_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
@@ -3397,7 +3396,6 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**type** | **str**| Type of requested plot |
|
||||
**binning** | **int**| Binning of frames for the plot (0 = default binning) | [optional] [default to 1]
|
||||
**compression** | **bool**| Enable DEFLATE compression of output data. | [optional] [default to False]
|
||||
**fill** | **float**| Fill value for elements that were missed during data collection | [optional]
|
||||
**experimental_coord** | **bool**| If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored | [optional] [default to False]
|
||||
**azint_unit** | **str**| Unit used for azim int. | [optional] [default to Q_recipA]
|
||||
@@ -3690,7 +3688,7 @@ No authorization required
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **statistics_get**
|
||||
> JfjochStatistics statistics_get(compression=compression)
|
||||
> JfjochStatistics statistics_get()
|
||||
|
||||
Get general statistics
|
||||
|
||||
@@ -3714,11 +3712,10 @@ configuration = jfjoch_client.Configuration(
|
||||
with jfjoch_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = jfjoch_client.DefaultApi(api_client)
|
||||
compression = False # bool | Enable DEFLATE compression of output data. (optional) (default to False)
|
||||
|
||||
try:
|
||||
# Get general statistics
|
||||
api_response = api_instance.statistics_get(compression=compression)
|
||||
api_response = api_instance.statistics_get()
|
||||
print("The response of DefaultApi->statistics_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
@@ -3729,10 +3726,7 @@ with jfjoch_client.ApiClient(configuration) as api_client:
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**compression** | **bool**| Enable DEFLATE compression of output data. | [optional] [default to False]
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ export type { binning } from './models/binning';
|
||||
export { broker_status } from './models/broker_status';
|
||||
export type { calibration_statistics } from './models/calibration_statistics';
|
||||
export { color_scale } from './models/color_scale';
|
||||
export type { compression } from './models/compression';
|
||||
export type { crystal_lattice } from './models/crystal_lattice';
|
||||
export type { dark_mask_settings } from './models/dark_mask_settings';
|
||||
export { dataset_settings } from './models/dataset_settings';
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Enable DEFLATE compression of output data.
|
||||
*/
|
||||
export type compression = boolean;
|
||||
@@ -802,19 +802,13 @@ export class DefaultService {
|
||||
|
||||
/**
|
||||
* Get general statistics
|
||||
* @param compression Enable DEFLATE compression of output data.
|
||||
* @returns jfjoch_statistics Everything OK
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getStatistics(
|
||||
compression: boolean = false,
|
||||
): CancelablePromise<jfjoch_statistics> {
|
||||
public static getStatistics(): CancelablePromise<jfjoch_statistics> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/statistics',
|
||||
query: {
|
||||
'compression': compression,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -996,7 +990,6 @@ export class DefaultService {
|
||||
* Generate 1D plot from Jungfraujoch
|
||||
* @param type Type of requested plot
|
||||
* @param binning Binning of frames for the plot (0 = default binning)
|
||||
* @param compression Enable DEFLATE compression of output data.
|
||||
* @param fill Fill value for elements that were missed during data collection
|
||||
*
|
||||
* @param experimentalCoord If measurement has goniometer axis defined, plot X-axis will represent rotation angle
|
||||
@@ -1011,7 +1004,6 @@ export class DefaultService {
|
||||
public static getPreviewPlot(
|
||||
type: 'bkg_estimate' | 'azint' | 'azint_1d' | 'spot_count' | 'spot_count_low_res' | 'spot_count_indexed' | 'spot_count_ice' | 'indexing_rate' | 'indexing_time' | 'indexing_unit_cell_length' | 'indexing_unit_cell_angle' | 'profile_radius' | 'mosaicity' | 'b_factor' | 'error_pixels' | 'saturated_pixels' | 'image_collection_efficiency' | 'receiver_delay' | 'receiver_free_send_buf' | 'strong_pixels' | 'roi_sum' | 'roi_mean' | 'roi_max_count' | 'roi_pixels' | 'roi_weighted_x' | 'roi_weighted_y' | 'packets_received' | 'max_pixel_value' | 'resolution_estimate' | 'pixel_sum' | 'processing_time' | 'beam_center_x' | 'beam_center_y',
|
||||
binning: number = 1,
|
||||
compression: boolean = false,
|
||||
fill?: number,
|
||||
experimentalCoord: boolean = false,
|
||||
azintUnit: 'Q_recipA' | 'd_A' | 'two_theta_deg' = 'Q_recipA',
|
||||
@@ -1021,7 +1013,6 @@ export class DefaultService {
|
||||
url: '/preview/plot',
|
||||
query: {
|
||||
'binning': binning,
|
||||
'compression': compression,
|
||||
'type': type,
|
||||
'fill': fill,
|
||||
'experimental_coord': experimentalCoord,
|
||||
|
||||
Reference in New Issue
Block a user