Skip to content
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

.github/workflows: Added format.yml, fixed pep8 violations #34

Merged
merged 5 commits into from
Mar 20, 2024
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
35 changes: 35 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: github-FORMAT
#test
on:
pull_request:
paths-ignore:
- '**/*.rst'
- '**/*.md'
- 'doc/**'
types: [ opened, reopened, synchronize ]

permissions:
contents: none

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

jobs:
format-check:
name: format-check
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: OpenCSP
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Black formatting check
run: |
pip install black
black . -S -C --check --diff
1 change: 1 addition & 0 deletions contrib/app/sofast/load_saved_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Library of functions that load saved Sofast HDF5 files
and return OpenCSP optics classes.
"""

import numpy as np
from scipy.spatial.transform import Rotation

Expand Down
1 change: 1 addition & 0 deletions contrib/app/sofast/run_and_characterize_sofast_1_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
NOTE: must be run with a computer connected to a working SOFAST system. This includes a camera,
mirror, screen, and system layout calibration files.
"""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions contrib/app/sofast/run_and_characterize_sofast_2_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
NOTE: must be run with a computer connected to a working SOFAST system. This includes a camera,
mirror, screen, and system layout calibration files.
"""

import os

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,28 @@

# Control parameters.
scan_parameters = {}
scan_parameters[
'locale'
] = 'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
scan_parameters['locale'] = (
'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
)
scan_parameters['camera'] = cam.sony_alpha_20mm_landscape() # Camera model.
# scan_parameters['camera'] = cam.sony_alpha_20mm_portrait() # Camera model.
scan_parameters['camera'] = cam.ultra_wide_angle() # Camera model.
# scan_parameters['camera'] = cam.mavic_zoom() # Camera model.
scan_parameters[
'section_plane_tolerance'
] = 3 # m. Lateral distance to include heliostats in section.
scan_parameters[
'p_margin'
] = 0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
scan_parameters[
'altitude_margin'
] = 2.5 # m. Clearance of highest possible heliostat point.
scan_parameters[
'maximum_safe_altitude'
] = 90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
scan_parameters[
'maximum_target_lookback'
] = 3 # Number of heliostats to look back for reflection targets.
scan_parameters['section_plane_tolerance'] = (
3 # m. Lateral distance to include heliostats in section.
)
scan_parameters['p_margin'] = (
0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
)
scan_parameters['altitude_margin'] = (
2.5 # m. Clearance of highest possible heliostat point.
)
scan_parameters['maximum_safe_altitude'] = (
90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
)
scan_parameters['maximum_target_lookback'] = (
3 # Number of heliostats to look back for reflection targets.
)
scan_parameters['gaze_tolerance'] = np.deg2rad(
1
) # Uncertainty in gaze angle. True angle is +/- tolerance from nominal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@
def construct_ufacet_scan(solar_field, lead_in, run_past):
# Control parameters.
scan_parameters = {}
scan_parameters[
'locale'
] = 'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
scan_parameters['locale'] = (
'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
)
scan_parameters['camera'] = cam.sony_alpha_20mm_landscape() # Camera model.
# scan_parameters['camera'] = cam.sony_alpha_20mm_portrait() # Camera model.
scan_parameters['camera'] = cam.ultra_wide_angle() # Camera model.
# scan_parameters['camera'] = cam.mavic_zoom() # Camera model.
scan_parameters[
'section_plane_tolerance'
] = 3 # m. Lateral distance to include heliostats in section.
scan_parameters[
'p_margin'
] = 0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
scan_parameters[
'altitude_margin'
] = 2.5 # m. Clearance of highest possible heliostat point.
scan_parameters[
'maximum_safe_altitude'
] = 90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
scan_parameters[
'maximum_target_lookback'
] = 3 # Number of heliostats to look back for reflection targets.
scan_parameters['section_plane_tolerance'] = (
3 # m. Lateral distance to include heliostats in section.
)
scan_parameters['p_margin'] = (
0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
)
scan_parameters['altitude_margin'] = (
2.5 # m. Clearance of highest possible heliostat point.
)
scan_parameters['maximum_safe_altitude'] = (
90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
)
scan_parameters['maximum_target_lookback'] = (
3 # Number of heliostats to look back for reflection targets.
)
scan_parameters['gaze_tolerance'] = np.deg2rad(
1
) # Uncertainty in gaze angle. True angle is +/- tolerance from nominal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@
def construct_ufacet_scan_pass(solar_field, lead_in, run_past):
# Control parameters.
scan_parameters = {}
scan_parameters[
'locale'
] = 'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
scan_parameters['locale'] = (
'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
)
scan_parameters['camera'] = cam.sony_alpha_20mm_landscape() # Camera model.
# scan_parameters['camera'] = cam.sony_alpha_20mm_portrait() # Camera model.
scan_parameters['camera'] = cam.ultra_wide_angle() # Camera model.
# scan_parameters['camera'] = cam.mavic_zoom() # Camera model.
scan_parameters[
'section_plane_tolerance'
] = 3 # m. Lateral distance to include heliostats in section.
scan_parameters[
'p_margin'
] = 0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
scan_parameters[
'altitude_margin'
] = 2.5 # m. Clearance of highest possible heliostat point.
scan_parameters[
'maximum_safe_altitude'
] = 90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
scan_parameters[
'maximum_target_lookback'
] = 3 # Number of heliostats to look back for reflection targets.
scan_parameters['section_plane_tolerance'] = (
3 # m. Lateral distance to include heliostats in section.
)
scan_parameters['p_margin'] = (
0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
)
scan_parameters['altitude_margin'] = (
2.5 # m. Clearance of highest possible heliostat point.
)
scan_parameters['maximum_safe_altitude'] = (
90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
)
scan_parameters['maximum_target_lookback'] = (
3 # Number of heliostats to look back for reflection targets.
)
scan_parameters['gaze_tolerance'] = np.deg2rad(
1
) # Uncertainty in gaze angle. True angle is +/- tolerance from nominal.
Expand Down Expand Up @@ -131,28 +131,28 @@ def construct_ufacet_scan_pass(solar_field, lead_in, run_past):
def construct_ufacet_scan_passes(solar_field, lead_in, run_past):
# Control parameters.
scan_parameters = {}
scan_parameters[
'locale'
] = 'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
scan_parameters['locale'] = (
'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
)
scan_parameters['camera'] = cam.sony_alpha_20mm_landscape() # Camera model.
# scan_parameters['camera'] = cam.sony_alpha_20mm_portrait() # Camera model.
scan_parameters['camera'] = cam.ultra_wide_angle() # Camera model.
# scan_parameters['camera'] = cam.mavic_zoom() # Camera model.
scan_parameters[
'section_plane_tolerance'
] = 3 # m. Lateral distance to include heliostats in section.
scan_parameters[
'p_margin'
] = 0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
scan_parameters[
'altitude_margin'
] = 2.5 # m. Clearance of highest possible heliostat point.
scan_parameters[
'maximum_safe_altitude'
] = 90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
scan_parameters[
'maximum_target_lookback'
] = 3 # Number of heliostats to look back for reflection targets.
scan_parameters['section_plane_tolerance'] = (
3 # m. Lateral distance to include heliostats in section.
)
scan_parameters['p_margin'] = (
0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
)
scan_parameters['altitude_margin'] = (
2.5 # m. Clearance of highest possible heliostat point.
)
scan_parameters['maximum_safe_altitude'] = (
90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
)
scan_parameters['maximum_target_lookback'] = (
3 # Number of heliostats to look back for reflection targets.
)
scan_parameters['gaze_tolerance'] = np.deg2rad(
1
) # Uncertainty in gaze angle. True angle is +/- tolerance from nominal.
Expand Down Expand Up @@ -211,28 +211,28 @@ def construct_ufacet_scan_passes(solar_field, lead_in, run_past):
def construct_ufacet_scan(solar_field, lead_in, run_past):
# Control parameters.
scan_parameters = {}
scan_parameters[
'locale'
] = 'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
scan_parameters['locale'] = (
'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
)
scan_parameters['camera'] = cam.sony_alpha_20mm_landscape() # Camera model.
# scan_parameters['camera'] = cam.sony_alpha_20mm_portrait() # Camera model.
scan_parameters['camera'] = cam.ultra_wide_angle() # Camera model.
# scan_parameters['camera'] = cam.mavic_zoom() # Camera model.
scan_parameters[
'section_plane_tolerance'
] = 3 # m. Lateral distance to include heliostats in section.
scan_parameters[
'p_margin'
] = 0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
scan_parameters[
'altitude_margin'
] = 2.5 # m. Clearance of highest possible heliostat point.
scan_parameters[
'maximum_safe_altitude'
] = 90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
scan_parameters[
'maximum_target_lookback'
] = 3 # Number of heliostats to look back for reflection targets.
scan_parameters['section_plane_tolerance'] = (
3 # m. Lateral distance to include heliostats in section.
)
scan_parameters['p_margin'] = (
0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
)
scan_parameters['altitude_margin'] = (
2.5 # m. Clearance of highest possible heliostat point.
)
scan_parameters['maximum_safe_altitude'] = (
90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
)
scan_parameters['maximum_target_lookback'] = (
3 # Number of heliostats to look back for reflection targets.
)
scan_parameters['gaze_tolerance'] = np.deg2rad(
1
) # Uncertainty in gaze angle. True angle is +/- tolerance from nominal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def setup_render_control_scan_section_analysis():
]
ufacet_control_parameters['curve_key_xy_list'] = ufacet_curve_key_xy_list
# Maximum altitude.
ufacet_control_parameters[
'maximum_altitude'
] = 25.0 # m. Maximum altitude, roughly AGL, including slope effects.
ufacet_control_parameters['maximum_altitude'] = (
25.0 # m. Maximum altitude, roughly AGL, including slope effects.
)
# Gaze control.
ufacet_control_parameters['gaze_type'] = 'constant' # 'constant' or 'linear'
ufacet_control_parameters['delta_eta'] = np.deg2rad(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def setup_render_control_scan_section_analysis():
]
ufacet_control_parameters['curve_key_xy_list'] = ufacet_curve_key_xy_list
# Maximum altitude.
ufacet_control_parameters[
'maximum_altitude'
] = 25.0 # m. Maximum altitude, roughly AGL, including slope effects.
ufacet_control_parameters['maximum_altitude'] = (
25.0 # m. Maximum altitude, roughly AGL, including slope effects.
)
# Gaze control.
ufacet_control_parameters['gaze_type'] = 'constant' # 'constant' or 'linear'
ufacet_control_parameters['delta_eta'] = np.deg2rad(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ def setup_render_control_scan_section_analysis():
ufacet_control_parameters['curve_key_xy_list'] = ufacet_curve_key_xy_list
# Maximum altitude.
# ufacet_control_parameters['maximum_altitude'] = 25.0 # m. Maximum altitude, roughly AGL, including slope effects.
ufacet_control_parameters[
'maximum_altitude'
] = 18.0 # m. Maximum altitude, roughly AGL, including slope effects.
ufacet_control_parameters['maximum_altitude'] = (
18.0 # m. Maximum altitude, roughly AGL, including slope effects.
)
# Gaze control.
ufacet_control_parameters['gaze_type'] = 'constant' # 'constant' or 'linear'
ufacet_control_parameters['delta_eta'] = np.deg2rad(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,28 @@

# Control parameters.
scan_parameters = {}
scan_parameters[
'locale'
] = 'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
scan_parameters['locale'] = (
'Sandia NSTTF' # Information needed to convert (x,y,z into global (longitude, latitude) coordinates.
)
scan_parameters['camera'] = cam.sony_alpha_20mm_landscape() # Camera model.
# scan_parameters['camera'] = cam.sony_alpha_20mm_portrait() # Camera model.
scan_parameters['camera'] = cam.ultra_wide_angle() # Camera model.
# scan_parameters['camera'] = cam.mavic_zoom() # Camera model.
scan_parameters[
'section_plane_tolerance'
] = 3 # m. Lateral distance to include heliostats in section.
scan_parameters[
'p_margin'
] = 0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
scan_parameters[
'altitude_margin'
] = 2.5 # m. Clearance of highest possible heliostat point.
scan_parameters[
'maximum_safe_altitude'
] = 90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
scan_parameters[
'maximum_target_lookback'
] = 3 # Number of heliostats to look back for reflection targets.
scan_parameters['section_plane_tolerance'] = (
3 # m. Lateral distance to include heliostats in section.
)
scan_parameters['p_margin'] = (
0 # 2 # m. Lateral distance to add to constraints to allow UAS postiion error.
)
scan_parameters['altitude_margin'] = (
2.5 # m. Clearance of highest possible heliostat point.
)
scan_parameters['maximum_safe_altitude'] = (
90.0 # meters. # ?? SCAFFOLDING -- BASE THIS ON TECHNICAL FACTORS: SOLAR FLUX, ETC
)
scan_parameters['maximum_target_lookback'] = (
3 # Number of heliostats to look back for reflection targets.
)
scan_parameters['gaze_tolerance'] = np.deg2rad(
1
) # Uncertainty in gaze angle. True angle is +/- tolerance from nominal.
Expand Down
Loading
Loading