Skip to content

Commit

Permalink
Merge pull request #34 from e10harvey/format_check
Browse files Browse the repository at this point in the history
.github/workflows: Added format.yml, fixed pep8 violations
  • Loading branch information
e10harvey authored Mar 20, 2024
2 parents e45f1e4 + 57fb35b commit 3838295
Show file tree
Hide file tree
Showing 160 changed files with 2,459 additions and 1,412 deletions.
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

0 comments on commit 3838295

Please sign in to comment.