Skip to content

Commit

Permalink
Merge pull request #53 from e10harvey/ubi8-nightly
Browse files Browse the repository at this point in the history
.github/workflows: Added ubi8-nightly.yml
  • Loading branch information
e10harvey authored Mar 28, 2024
2 parents d00ed82 + f7fbddf commit 783895a
Show file tree
Hide file tree
Showing 28 changed files with 125 additions and 63 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ubi8-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: github-UBI8-NIGHTLY

# Runs every night at midnight
on:
schedule:
- cron: '00 00 * * *'

permissions:
contents: none

# Cancels any in progress 'workflow' associated with this PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ubi8-nightly:
name: ubi8-nightly
runs-on: [ubuntu-latest]
permissions:
packages: read
contents: read
container:
image: ghcr.io/sandialabs/opencsp:latest-ubi8
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: checkout
uses: actions/checkout@v4
with:
path: OpenCSP

- name: pytest-cov
working-directory: OpenCSP/example
run: |
python3 -m pip install -r ../requirements.txt
export PYTHONPATH=$PWD/../
pytest --color=yes -rs -vv --cov=. --cov-report term --cov-config=.coveragerc
10 changes: 7 additions & 3 deletions example/scene_reconstruction/example_scene_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import opencsp.common.lib.tool.log_tools as lt


def example_scene_reconstruction(save_dir: str):
def scene_reconstruction(save_dir):
"""Example script that reconstructs the XYZ locations of Aruco markers in a scene."""
# Define input directory
dir_input = join(opencsp_code_dir(), 'app/scene_reconstruction/test/data/data_measurement')
Expand Down Expand Up @@ -45,12 +45,16 @@ def example_scene_reconstruction(save_dir: str):
fig.savefig(join(save_dir, fig.get_label() + '.png'))


if __name__ == '__main__':
def example_driver():
# Define output directory
save_path = join(dirname(__file__), 'data/output/scene_reconstruction')
ft.create_directories_if_necessary(save_path)

# Set up logger
lt.logger(join(save_path, 'log.txt'), lt.log.INFO)

example_scene_reconstruction(save_path)
scene_reconstruction(save_path)


if __name__ == '__main__':
example_driver()
10 changes: 7 additions & 3 deletions example/sofast_fringe/example_calibration_camera_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import opencsp.common.lib.tool.log_tools as lt


def example_run_camera_position_calibration(save_dir: str):
def run_camera_position_calibration(save_dir):
"""Calibrates the position of the Sofast camera. Saves the rvec/tvec that
define the relative pose of the camera/screen to a CSV file located
at ./data/output/camera_rvec_tvec.csv
Expand Down Expand Up @@ -47,12 +47,16 @@ def example_run_camera_position_calibration(save_dir: str):
cal.save_data_as_csv(join(save_dir, 'camera_rvec_tvec.csv'))


if __name__ == '__main__':
def example_driver():
# Define save dir
save_path = join(dirname(__file__), 'data/output/camera_pose')
ft.create_directories_if_necessary(save_path)

# Set up logger
lt.logger(join(save_path, 'log.txt'))

example_run_camera_position_calibration(save_path)
run_camera_position_calibration(save_path)


if __name__ == '__main__':
example_driver()
10 changes: 7 additions & 3 deletions example/sofast_fringe/example_calibration_screen_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import opencsp.common.lib.tool.log_tools as lt


def example_run_screen_shape_calibration(save_dir):
def run_screen_shape_calibration(save_dir):
"""Runs screen shape calibration. Saves data to ./data/output/screen_shape"""
# Load output data from Scene Reconstruction (Aruco marker xyz points)
file_pts_data = join(
Expand Down Expand Up @@ -66,12 +66,16 @@ def example_run_screen_shape_calibration(save_dir):
fig.savefig(file)


if __name__ == '__main__':
def example_driver():
# Define save directory
save_path = join(dirname(__file__), 'data/output/screen_shape')
ft.create_directories_if_necessary(save_path)

# Set up logger
lt.logger(join(save_path, 'log.txt'), lt.log.INFO)

example_run_screen_shape_calibration(save_path)
run_screen_shape_calibration(save_path)


if __name__ == '__main__':
example_driver()
10 changes: 7 additions & 3 deletions example/sofast_fringe/example_process_facet_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import opencsp.common.lib.tool.log_tools as lt


def example_driver(dir_save: str):
def example(dir_save: str):
"""Example SOFAST script
Performs processing of previously collected Sofast data of multi facet mirror ensemble.
Expand Down Expand Up @@ -109,12 +109,16 @@ def example_driver(dir_save: str):
sofast.save_to_hdf(f'{dir_save}/data_multifacet.h5')


if __name__ == '__main__':
def example_driver():
# Define save dir
save_path = join(dirname(__file__), 'data/output/facet_ensemble')
ft.create_directories_if_necessary(save_path)

# Set up logger
lt.logger(join(save_path, 'log.txt'), lt.log.INFO)

example_driver(save_path)
example(save_path)


if __name__ == '__main__':
example_driver()
10 changes: 7 additions & 3 deletions example/sofast_fringe/example_process_single_facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import opencsp.common.lib.tool.log_tools as lt


def example_driver(dir_save: str):
def example(dir_save: str):
"""Example SOFAST script
Performs processing of previously collected Sofast data of single facet mirror.
Expand Down Expand Up @@ -85,12 +85,16 @@ def example_driver(dir_save: str):
sofast.save_to_hdf(f'{dir_save}/data_singlefacet.h5')


if __name__ == '__main__':
def example_driver():
# Define save dir
save_path = join(dirname(__file__), 'data/output/single_facet')
ft.create_directories_if_necessary(save_path)

# Set up logger
lt.logger(join(save_path, 'log.txt'), lt.log.INFO)

example_driver(save_path)
example(save_path)


if __name__ == '__main__':
example_driver()
10 changes: 7 additions & 3 deletions example/sofast_fringe/example_process_undefined_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import opencsp.common.lib.tool.log_tools as lt


def example_driver(dir_save):
def example(dir_save):
"""Example SOFAST script
Performs processing of previously collected Sofast data of single facet mirror.
Expand Down Expand Up @@ -83,12 +83,16 @@ def example_driver(dir_save):
sofast.save_to_hdf(f'{dir_save}/data_undefined.h5')


if __name__ == '__main__':
def example_driver():
# Define save dir
save_path = join(dirname(__file__), 'data/output/single_facet')
ft.create_directories_if_necessary(save_path)

# Set up logger
lt.logger(join(save_path, 'log.txt'), lt.log.INFO)

example_driver(save_path)
example(save_path)


if __name__ == '__main__':
example_driver()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from scipy.spatial.transform import Rotation

import opencsp.app.sofast.lib.load_saved_data as lsd
import contrib.app.sofast.load_saved_data as lsd
import opencsp.common.lib.csp.standard_output as so
from opencsp.common.lib.csp.LightSourceSun import LightSourceSun
from opencsp.common.lib.geometry.Uxyz import Uxyz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo001_Heliostat 5E10, Face West
Title: Heliostat 5E10, Face West
Code tag: ExampleSolarFieldOutput.example_single_heliostat()
Code tag: ExampleSolarFieldOutput.single_heliostat()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo002_Heliostat 5E10, with Highlighting
Title: Heliostat 5E10, with Highlighting
Code tag: ExampleSolarFieldOutput.example_annotated_heliostat()
Code tag: ExampleSolarFieldOutput.annotated_heliostat()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo003_Example Poses and Styles
Title: Example Poses and Styles
Code tag: ExampleSolarFieldOutput.example_multi_heliostat()
Code tag: ExampleSolarFieldOutput.multi_heliostat()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo004_Heliostat Names
Title: Heliostat Names
Code tag: ExampleSolarFieldOutput.example_solar_field_h_names()
Code tag: ExampleSolarFieldOutput.solar_field_h_names()
View spec: xy

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo005_Heliostat Centroids
Title: Heliostat Centroids
Code tag: ExampleSolarFieldOutput.example_solar_field_h_centroids()
Code tag: ExampleSolarFieldOutput.solar_field_h_centroids()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 2
Name: tsfo006_Heliostat Centroids
Title: Heliostat Centroids
Code tag: ExampleSolarFieldOutput.example_solar_field_h_centroids()
Code tag: ExampleSolarFieldOutput.solar_field_h_centroids()
View spec: xy

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 3
Name: tsfo007_Heliostat Centroids
Title: Heliostat Centroids
Code tag: ExampleSolarFieldOutput.example_solar_field_h_centroids()
Code tag: ExampleSolarFieldOutput.solar_field_h_centroids()
View spec: xz

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 4
Name: tsfo008_Heliostat Centroids
Title: Heliostat Centroids
Code tag: ExampleSolarFieldOutput.example_solar_field_h_centroids()
Code tag: ExampleSolarFieldOutput.solar_field_h_centroids()
View spec: yz

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo009_Heliostat Labelled Centroids
Title: Heliostat Labelled Centroids
Code tag: ExampleSolarFieldOutput.example_solar_field_h_centroids_names()
Code tag: ExampleSolarFieldOutput.solar_field_h_centroids_names()
View spec: xy

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo010_Heliostat Outlines
Title: Heliostat Outlines
Code tag: ExampleSolarFieldOutput.example_solar_field_h_outlines()
Code tag: ExampleSolarFieldOutput.solar_field_h_outlines()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo011_Solar Field Situation
Title: Solar Field Situation
Code tag: ExampleSolarFieldOutput.example_annotated_solar_field()
Code tag: ExampleSolarFieldOutput.annotated_solar_field()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo012_Selected Heliostats
Title: Selected Heliostats
Code tag: ExampleSolarFieldOutput.example_solar_field_subset()
Code tag: ExampleSolarFieldOutput.solar_field_subset()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo013_Heliostat Vector Field
Title: Heliostat Vector Field
Code tag: ExampleSolarFieldOutput.example_heliostat_vector_field()
Code tag: ExampleSolarFieldOutput.heliostat_vector_field()
View spec: 3d

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 2
Name: tsfo014_Heliostat Vector Field
Title: Heliostat Vector Field
Code tag: ExampleSolarFieldOutput.example_heliostat_vector_field()
Code tag: ExampleSolarFieldOutput.heliostat_vector_field()
View spec: xy

Title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ Metadata:
Figure number: 3
Name: tsfo015_Heliostat Vector Field
Title: Heliostat Vector Field
Code tag: TestSolarFieldOutput.test_heliostat_vector_field()
Code tag: ExampleSolarFieldOutput.heliostat_vector_field()
View spec: xz
Path: common\lib\test\data\output\TestSolarFieldOutput\tsfo015_Heliostat_Vector_Field_xz.png

Title:
Heliostat Vector Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ Metadata:
Figure number: 4
Name: tsfo016_Heliostat Vector Field
Title: Heliostat Vector Field
Code tag: TestSolarFieldOutput.test_heliostat_vector_field()
Code tag: ExampleSolarFieldOutput.heliostat_vector_field()
View spec: yz
Path: common\lib\test\data\output\TestSolarFieldOutput\tsfo016_Heliostat_Vector_Field_yz.png

Title:
Heliostat Vector Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata:
Figure number: 1
Name: tsfo017_Dense Tracking Vector Field
Title: Dense Tracking Vector Field
Code tag: ExampleSolarFieldOutput.example_dense_vector_field()
Code tag: ExampleSolarFieldOutput.dense_vector_field()
View spec: xy

Title:
Expand Down
Loading

0 comments on commit 783895a

Please sign in to comment.