Skip to content

Feat: Use new version of ansys-api-speos & docker image speos-rpc (24r1) #120

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

Merged
merged 5 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.4"
services:
optics_speos-rpc:
image: ghcr.io/pyansys/pyoptics/speos-rpc:2023.2.0.666
image: ghcr.io/pyansys/pyoptics/speos-rpc:2024.1.0.686
container_name: optics_speos-rpc
ports:
- "50051:50051"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers=[
dependencies=[
"grpcio==1.51.3",
"grpcio-tools==1.48.2",
"ansys-api-speos==0.2.0",
"ansys-api-speos==0.3.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
OPTIS - Optical distortion file v1.0
created by LMR 2011-01-22
0
51
0.0000 0.0000
0.0227 0.0211
0.0454 0.0421
0.0681 0.0631
0.0908 0.0840
0.1134 0.1048
0.1361 0.1255
0.1588 0.1461
0.1815 0.1665
0.2042 0.1868
0.2269 0.2069
0.2496 0.2268
0.2723 0.2465
0.2950 0.2660
0.3176 0.2852
0.3403 0.3043
0.3630 0.3231
0.3857 0.3416
0.4084 0.3599
0.4311 0.3779
0.4538 0.3956
0.4765 0.4131
0.4992 0.4302
0.5219 0.4471
0.5445 0.4637
0.5672 0.4800
0.5899 0.4961
0.6126 0.5118
0.6353 0.5273
0.6580 0.5424
0.6807 0.5573
0.7034 0.5719
0.7261 0.5862
0.7487 0.6002
0.7714 0.6139
0.7941 0.6274
0.8168 0.6406
0.8395 0.6535
0.8622 0.6662
0.8849 0.6786
0.9076 0.6907
0.9303 0.7026
0.9529 0.7143
0.9756 0.7257
0.9983 0.7368
1.0210 0.7478
1.0437 0.7585
1.0664 0.7690
1.0891 0.7792
1.1118 0.7893
1.1345 0.7991
Binary file not shown.
11 changes: 7 additions & 4 deletions tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ def test_job():
simulation__v1__pb2.Load_Request(guid=simu_create_res.guid, input_file_path=speos_simulation_full_path)
)

# Allocate job from simu
job_create_res = job_manager_stub.Create(
job__v1__pb2.Create_Request(simu_guid=simu_create_res.guid, job_type=job__v1__pb2.Job_Type.CPU)
)
# Allocate job from simu guid, job type and simu properties
j = job__v1__pb2.Job()
j.simu_guid = simu_create_res.guid
j.job_type = job__v1__pb2.Job_Type.CPU
j.direct_mc_simulation_properties.stop_condition_rays_number = 500000
j.direct_mc_simulation_properties.automatic_save_frequency = 60
job_create_res = job_manager_stub.Create(job__v1__pb2.Create_Request(job=j))

# Start the job
job_stub.Start(job__v1__pb2.Start_Request(guid=job_create_res.guid))
Expand Down
12 changes: 8 additions & 4 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_create_camera_sensor():
distortion = os.path.join(camera_input_files_path, "CameraDistortion.OPTDistortion")

camera_t = sensor_pb2.SensorTemplate()
camera_t.camera_sensor_template.sensor_name = "CameraSensorPhotometric"
camera_t.name = "CameraSensorPhotometric"
camera_t.camera_sensor_template.sensor_mode_photometric.transmittance_file_uri = transmittance
camera_t.camera_sensor_template.sensor_mode_photometric.gamma_correction = 2.2
camera_t.camera_sensor_template.sensor_mode_photometric.color_mode_color.red_spectrum_file_uri = red_spectrum
Expand All @@ -83,7 +83,7 @@ def test_create_camera_sensor():

# Create a camera sensor using template + properties
camera_sensor = simulation_pb2.Sensor()
camera_sensor.name = camera_t.camera_sensor_template.sensor_name + "_1"
camera_sensor.name = camera_t.name + "_1"
camera_sensor.guid = cam_sensor_create_res.guid

camera_sensor.camera_sensor_properties.sensor_position.origin[:] = [25.0, 0.0, 0.0]
Expand All @@ -103,8 +103,12 @@ def test_create_camera_sensor():
target="localhost:" + str(config.get("SpeosServerPort")),
stub_type=job_pb2_grpc.SpeosJobsManagerStub,
)
job_create_req = job_pb2.Create_Request(simu_guid=simu_create_res.guid, job_type=job_pb2.Job_Type.CPU)
job_create_res = job_manager_stub.Create(job_create_req)
j = job_pb2.Job()
j.simu_guid = simu_create_res.guid
j.job_type = job_pb2.Job_Type.CPU
j.inverse_mc_simulation_properties.optimized_propagation_none.stop_condition_passes_number = 5
j.inverse_mc_simulation_properties.automatic_save_frequency = 1800
job_create_res = job_manager_stub.Create(job_pb2.Create_Request(job=j))

# Start the job
job_stub = grpc_stub.get_stub_insecure_channel(
Expand Down
Loading