### Execute SunPeek Setup Script Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_linux.rst After downloading the script, execute it to proceed with the SunPeek setup. You will be prompted to enter the URL for accessing SunPeek. ```bash sh ./quick-setup.sh ``` -------------------------------- ### Download and Run SunPeek Installer Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_windows.rst Download the installer zip file, unzip it, and run the executable. You may need administrator rights. Configure the installation directory and URL in the provided window. ```bash sunpeek_easy_installer.exe ``` -------------------------------- ### Start SunPeek Service Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_windows.rst Navigate to the installation directory and double-click the start.bat file to launch SunPeek. Docker Compose will download necessary components. Close the command prompt once all components are started. ```batch start.bat ``` -------------------------------- ### Install SunPeek with Demo Data Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/getting_started.rst Install the SunPeek package with the 'demo' extra to include sample data for the tutorial. For production, 'pip install sunpeek' is sufficient. ```console pip install sunpeek[demo] ``` -------------------------------- ### Build Installer Package Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Use PyInstaller to create the installer package on Windows. The resulting folder needs to be zipped manually. ```bash pyinstaller .\sunpeek_easy_installer.spec --distpath=. ``` -------------------------------- ### Download SunPeek Setup Script Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_linux.rst Use this command to download the bash script for setting up SunPeek. Run this in the directory where you want to store SunPeek configuration. ```bash curl https://gitlab.com/sunpeek/sunpeek/-/raw/main/deploy/quick-setup.sh?inline=false -o quick-setup.sh ``` -------------------------------- ### Repository Summary Output Example Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst This is an example of the tabular output generated by the script, detailing repository status, cloning, and counting information. ```text Repository Summary: Repository Local Status Will Clone Will Count ----------------------- -------------- ------------ ------------ common-utils MISSING SKIP N/A example-data EXISTS YES YES nginx MISSING SKIP SKIP parquet-datastore-utils EXISTS YES YES poetry-docker MISSING SKIP SKIP sunpeek EXISTS YES YES sunpeek-collectors EXISTS YES SKIP sunpeek-d-cat MISSING SKIP SKIP sunpeek-d-cat-2 EXISTS YES SKIP sunpeek-governance EXISTS YES YES support MISSING SKIP SKIP web-ui EXISTS YES YES Summary Statistics: Metric Count --------------------- ------- Total repositories 12 Will be cloned 7 Will be counted 5 Exist locally 7 Missing locally 0 Skipped from cloning 5 Skipped from counting 6 ``` -------------------------------- ### Run SunPeek API Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Execute the main entry point script to start the SunPeek API. This command also initializes the database. The API documentation will be available at http://localhost:8000/docs. ```bash python entrypoint.py ``` -------------------------------- ### Install Project Dependencies with Poetry Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Installs project dependencies and development tools using Poetry. If Poetry encounters errors, try running `poetry lock` first. ```bash poetry install --with dev ``` -------------------------------- ### Start Debugging Environment (Windows) Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Execute the debug-env.bat script in the dev-utils directory to set up the SunPeek Docker image for debugging on Windows. ```batch cd ./dev-utils .\debug-env.bat ``` -------------------------------- ### Start Debugging Environment (Linux) Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Execute the debug-env.sh script in the dev-utils directory to set up the SunPeek Docker image for debugging on Linux. ```bash cd ./dev-utils ./debug-env.sh ``` -------------------------------- ### Install Git LFS Hooks Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/getting_started.rst If you have cloned the SunPeek repository for development and encounter issues with PNG files or missing assets, install Git LFS hooks and pull LFS content. ```console git lfs install --force git lfs pull ``` -------------------------------- ### Create a QDT Collector Programmatically in Python Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/collectors.rst Example of how to define a custom Quasi-Dynamic Test (QDT) collector using the SunPeek Python API. Ensure all required performance parameters from a Solar Keymark certificate are provided. ```python from sunpeek.components import CollectorQDT, CollectorTypes, IAM_Interpolated from sunpeek.common.unit_uncertainty import Q collector = CollectorQDT( name='my collector', manufacturer_name='xyz', product_name='abc', collector_type=CollectorTypes.flat_plate, test_reference_area='gross', area_gr=Q(12, 'm**2'), gross_length=Q(2400, 'mm'), gross_width=Q(5000, 'mm'), gross_height=Q(150, 'mm'), # Performance parameters from Solar Keymark certificate eta0b=Q(0.75, ''), a1=Q(2.3, 'W m**-2 K**-1'), a2=Q(0.01, 'W m**-2 K**-2'), a5=Q(7.5, 'kJ m**-2 K**-1'), kd=Q(0.94, ''), iam_method=IAM_Interpolated( aoi_reference=Q([10, 20, 30, 40, 50, 60, 70, 80, 90], 'deg'), iam_reference=Q([1, 0.99, 0.97, 0.94, 0.9, 0.82, 0.65, 0.32, 0]), ), ) ``` -------------------------------- ### Run SunPeek with Docker Compose Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_linux.rst Start SunPeek services in detached mode using Docker Compose. The initial startup may take several minutes as Docker downloads the necessary components. ```bash docker compose up -d ``` -------------------------------- ### Configure Fixed Mounting Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Use MountingFixed for fixed-tilt installations with constant orientation. Parameters include surface_tilt and surface_azimuth. ```python from sunpeek.components import Array, MountingFixed from sunpeek.common.unit_uncertainty import Q ``` -------------------------------- ### Import Plant Configuration from JSON Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/advanced_topics.rst Imports a plant configuration from a JSON file to recreate an exact plant setup. This is useful for restoring configurations or collaborating with others. ```python from sunpeek.common.config_parser import make_plant_from_config_file # Define the path to the configuration file config_file = 'plant_config.json' # Assumes this file exists and was created by export_config # Import the plant configuration imported_plant = make_plant_from_config_file(config_file) # The 'imported_plant' object is now a Plant instance with the configuration loaded from the file. # You can use it for further analysis or verification. print(f"Plant configuration imported successfully from {config_file}") ``` -------------------------------- ### Build SunPeek Documentation Locally Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/contributing/docs.rst Run this command in the console to build the HTML documentation from the source files. This is useful for previewing changes before committing. ```bash sphinx-build -b html ./docs/source/ ./docs/build/ ``` -------------------------------- ### Run SunPeek with Custom Plant Configuration Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/getting_started.rst This Python script demonstrates how to use SunPeek for custom plants without a pre-existing configuration file. It covers defining sensors, creating the plant, configuring collectors and fluids, adding arrays, loading data, and performing analysis. ```python from sunpeek.config import Plant, Sensor, Collector, Fluid, MountingFixed, Array from sunpeek.data import MeasurementData from sunpeek.analysis import PowerCheck # 1. Define sensors with their units and metadata sensors = [ Sensor("T_amb", "°C", "ambient temperature"), Sensor("T_collector", "°C", "collector temperature"), Sensor("POA_irradiance", "W/m²", "plane of array irradiance"), Sensor("T_fluid_in", "°C", "fluid inlet temperature"), Sensor("T_fluid_out", "°C", "fluid outlet temperature"), Sensor("flow_rate", "l/min", "mass flow rate"), Sensor("P_el", "kW", "electrical power output"), ] # 2. Create the plant with location and sensor mappings plant = Plant( name="CustomPlant", location=("Graz", 46.6, 15.4, 150.0), # City, Latitude, Longitude, Altitude sensors=sensors, sensor_mapping={ "T_amb": "T_amb", "T_collector": "T_collector", "POA_irradiance": "POA_irradiance", "T_fluid_in": "T_fluid_in", "T_fluid_out": "T_fluid_out", "flow_rate": "flow_rate", "P_el": "P_el", }, ) # 3. Configure the solar collector and heat transfer fluid collector = Collector( name="FlatPlateCollector", type="flatplate", area=2.0, # m² eta_0=0.8, # dimensionless alpha_1=0.005, # 1/K a1=0.005, # 1/K a2=0.0001, # 1/(K*m²) c1=5.0, # W/(m²*K) c2=0.01, # W/(m²*K²) ) fluid = Fluid(name="Water", type="water") # 4. Create the array and add it to the plant array = Array( name="DemoArray", collector=collector, fluid=fluid, mounting=MountingFixed(tilt=35.0, azim=0.0), # Tilt in degrees, Azimuth in degrees (0=South) n_collectors_series=10, n_collectors_parallel=2, ) plant.add_array(array) # 5. Load measurement data # Data is available at https://doi.org/10.5281/zenodo.7741084 # For this example, we use the data from the demo plant configuration # (see script_custom_plant.py for details) data = MeasurementData.from_plant(plant, "2023-01-01", "2023-12-31") # 6. Perform Power Check analysis and generate a report analysis = PowerCheck(plant, data) results = analysis.run() # Print results print(results) # Optional: Generate a report (e.g., PDF) # analysis.generate_report("custom_plant_report.pdf") ``` -------------------------------- ### Pull Latest SunPeek Docker Images Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_linux.rst Download the most recent versions of the Docker images for SunPeek. This is the first step in updating your SunPeek installation. ```bash docker compose pull ``` -------------------------------- ### Run SunPeek with Pre-defined Demo Plant Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/getting_started.rst This Python script demonstrates how to use SunPeek with a pre-defined demo plant, such as the FHW plant in Graz, Austria. It covers creating a plant object, loading measurement data, and performing a Power Check analysis. ```python from sunpeek.config import Plant from sunpeek.data import MeasurementData from sunpeek.analysis import PowerCheck # 1. Create SunPeek plant object plant = Plant.from_config("FHW", "Graz") # 2. Load measurement data # Data is available at https://doi.org/10.5281/zenodo.7741084 # For this example, we use the data from the demo plant configuration # (see script_demo_preconfigured.py for details) data = MeasurementData.from_plant(plant, "2023-01-01", "2023-12-31") # 3. Perform Power Check analysis analysis = PowerCheck(plant, data) results = analysis.run() # Print results print(results) ``` -------------------------------- ### Get Surface Tilt and Ideal Rotation Angle Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Accesses the surface tilt as a time series and the ideal rotation angle from a tracking array. ```python surface_tilt = tracking_array.mounting.surface_tilt.data print(f"Surface tilt range: {surface_tilt.min():.1f} to {surface_tilt.max():.1f}") # Get ideal rotation angle ideal_rotation = tracking_array.mounting.ideal_rotation_angle.data ``` -------------------------------- ### Recommended Array Syntax with MountingFixed Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Shows the recommended syntax for defining an array using the explicit 'mounting' parameter with a MountingFixed configuration. This improves clarity and enables future tracking support. ```python array = Array( name='Array', plant=plant, collector=collector, mounting=MountingFixed( surface_tilt=Q(30, 'deg'), surface_azimuth=Q(180, 'deg'), ), area_gr=Q(500, 'm**2'), sensor_map={...}, ) ``` -------------------------------- ### Register Custom Fluid in Enum Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/fluids.rst Example of how to register a new custom fluid within the WPDFluids enum in `fluid_definitions.py`. This involves creating a WPDFluidInfo object with relevant details about the fluid. ```python class WPDFluids(enum.Enum): # ... existing fluids ... # Your new fluid my_custom_fluid = WPDFluidInfo( 'My Custom Fluid', # Must match the folder name is_pure=True, # True for fixed concentration, False for variable unit_density={'te': 'degC', 'out': 'kg m**-3'}, unit_heat_capacity={'te': 'degC', 'out': 'J g**-1 K**-1'}, # for mixed fluids (variable concentration), include the concentration unit 'c' # unit_density={'te': 'degC', 'c': 'percent', 'out': 'kg m**-3'}, # unit_heat_capacity={'te': 'degC', 'c': 'percent', 'out': 'kJ kg**-1 K**-1'}, manufacturer='Manufacturer Name', description='Description of the fluid' ) ``` -------------------------------- ### Instantiate Fluid Objects Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/fluids.rst Demonstrates how to create fluid instances using FluidFactory, distinguishing between pure and mixed fluids. For mixed fluids, concentration must be specified during instantiation. ```python from sunpeek.components import FluidFactory from sunpeek.definitions.fluid_definitions import get_definition from sunpeek.common.unit_uncertainty import Q # For pure fluids (like water) water_def = get_definition('water') water = FluidFactory(fluid=water_def) # For mixed fluids (concentration required) glycol_def = get_definition('APG') glycol = FluidFactory(fluid=glycol_def, concentration=Q(30, 'percent')) ``` -------------------------------- ### List Repositories Only Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Employ the --list-repos flag to display a list of all available repositories and then exit the script without performing any cloning or analysis. ```bash python get_lines_of_code.py --list-repos ``` -------------------------------- ### LOC Analysis Results Summary Example Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst This text block shows the overall summary statistics produced by the cloc tool after analyzing the code, including counts for files, blank lines, comment lines, and source lines. ```text LINES OF CODE ANALYSIS RESULTS =============================== OVERALL SUMMARY: Total Files: 1,301 Blank Lines: 126,440 Comment Lines: 14,418 Source Lines: 428,239 ``` -------------------------------- ### Configure PostgreSQL Database Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/operations/supported_databases.rst Set these environment variables in `api.env` and `db.env` to use PostgreSQL. Ensure `HIT_DB_PW` and `POSTGRES_PASSWORD` are identical. ```bash HIT_DB_TYPE=postgresql HIT_DB_PW= POSTGRES_PASSWORD= ``` -------------------------------- ### Preview Analysis Mode Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Simulates the analysis process without making any changes to repositories. Useful for testing configurations and viewing potential actions. Use --log-level DEBUG for detailed output. ```bash # See what would happen without making changes python get_lines_of_code.py --dry-run --log-level DEBUG ``` -------------------------------- ### Run Complete Analysis Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Sets the GitLab token and executes a full analysis of repositories. Ensure the GITLAB_TOKEN_LOC environment variable is set. ```bash # Set GitLab token export GITLAB_TOKEN_LOC="your-gitlab-token" # Run complete analysis python get_lines_of_code.py ``` -------------------------------- ### Configure Single-Axis Tracking Mounting System Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Sets up a single-axis tracking system. The orientation is automatically calculated by pvlib. Common configurations include horizontal N-S or E-W axes, or a tilted axis matching latitude. ```python from sunpeek.components import Array, MountingSingleAxis from sunpeek.common.unit_uncertainty import Q ``` -------------------------------- ### Use Custom Configuration File Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Specify a custom configuration file using the --config option when the default 'loc_config.yaml' is not suitable. ```bash python get_lines_of_code.py --config custom_config.yaml ``` -------------------------------- ### Run Backend Tests with Coverage Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/contributing/contributing.rst Execute backend unit tests and generate a code coverage report. Ensure you are in the project's virtual environment before running this command. ```bash python -m pytest --cov-config=.coveragerc --cov=./ ./tests/ ``` -------------------------------- ### Configure Environment Variables Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Sets up a `.env` file for debugging operations, specifying database type and host. ```dotenv HIT_DB_TYPE=sqlite HIT_DB_HOST=//sunpeek_db_test.sqlite ``` -------------------------------- ### Legacy Array Syntax Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Demonstrates the older syntax for defining an array with direct tilt and azimuth parameters. This syntax is still supported but the explicit 'mounting' parameter is recommended for new code. ```python array = Array( name='Array', plant=plant, collector=collector, tilt=Q(30, 'deg'), azim=Q(180, 'deg'), area_gr=Q(500, 'm**2'), sensor_map={...}, ) ``` -------------------------------- ### Create Database Migrations Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Use the provided shell script to generate database migration files. These files are essential for updating user databases without data loss and must be manually reviewed for correctness. ```bash alembic/create_migrations.sh ``` -------------------------------- ### Run Complete LOC Analysis Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Execute the script to perform a complete analysis of all repositories, including cloning and counting lines of code. ```bash python get_lines_of_code.py ``` -------------------------------- ### Maintenance Mode: Quick Analysis Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Performs a quick analysis on already cloned repositories, skipping the cloning and updating steps. This is efficient for re-analyzing existing codebases. ```bash # Quick analysis of existing repositories python get_lines_of_code.py --no-clone --no-update ``` -------------------------------- ### Test Database Migrations Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Execute the migration test script to verify the integrity of database migrations. Docker is required for this script to function correctly. ```bash alembic/test_migrations.sh ``` -------------------------------- ### Backward Compatibility for Array Orientation Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Shows how legacy 'tilt' and 'azim' parameters on an Array object are automatically converted to MountingFixed internally for backward compatibility. ```python # For backward compatibility, the legacy ``tilt`` and ``azim`` parameters on ``Array`` still work. # They are automatically converted to ``MountingFixed`` internally: ``` -------------------------------- ### Verify API Backend Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/CONTRIBUTING.md Check if the SunPeek API backend is responsive by accessing the ping endpoint. Requires a valid token. ```bash http://localhost:8000/config/ping_backend?token=harvestIT ``` -------------------------------- ### Configure Fixed Mounting System Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/arrays_and_mounting.rst Defines a fixed mounting system with specific tilt and azimuth angles for a solar array. Ensure 'plant' and 'collector' objects are defined prior to creating the array. ```python mounting = MountingFixed( surface_tilt=Q(30, 'deg'), surface_azimuth=Q(180, 'deg'), # South ) array = Array( name='Fixed array', plant=plant, collector=collector, mounting=mounting, area_gr=Q(500, 'm**2'), sensor_map={...}, ) ``` -------------------------------- ### Create and Add Multiple Arrays to a Plant Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/advanced_topics.rst Define multiple array configurations with specific mounting and collector details, then add them to a plant object for analysis. The `run_power_check` function automatically processes all arrays within the plant. ```python array_1 = Array( name='Some array', plant=plant, collector=some_collector, mounting=MountingFixed( surface_tilt=Q(30, 'deg'), surface_azimuth=Q(160, 'deg'), ), area_gr=Q(100, 'm**2'), sensor_map=(...) ) array_2 = Array( name='Another array', plant=plant, collector=another_collector, mounting=MountingFixed( surface_tilt=Q(40, 'deg'), surface_azimuth=Q(210, 'deg'), ), area_gr=Q(100, 'm**2'), sensor_map=(...) ) # Add arrays to plant plant.add_array([array_1, array_2]) # Power Check analyzes all arrays automatically result = run_power_check(plant) print(f"Analyzed {len(plant.arrays)} arrays") ``` -------------------------------- ### Export Plant Configuration to JSON Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/advanced_topics.rst Exports the complete plant configuration, including sensors, fluid, and collector parameters, to a human-readable JSON file. This is useful for documentation and sharing. ```python import json from sunpeek.exporter import create_export_config from sunpeek.config import Plant plant = Plant() # Create the configuration dictionary config_data = create_export_config(plant) # Define the output file path output_file = 'plant_config.json' # Write the configuration to a JSON file with open(output_file, 'w') as f: json.dump(config_data, f, indent=4) print(f"Plant configuration exported to {output_file}") ``` -------------------------------- ### Allow Updating Dirty Repositories Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Use the --force-dirty option to enable updates for repositories that have uncommitted local changes. ```bash python get_lines_of_code.py --force-dirty ``` -------------------------------- ### Export and Import Plant Configuration Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/advanced_topics.rst Export the current plant configuration to a JSON file and import it later to recreate the plant object. The `default=str` argument handles non-serializable types. ```python config_dict = create_export_config(plant) with open('plant_config.json', 'w') as f: json.dump(config_dict, f, indent=2, default=str) # Import configuration later plant_reloaded = make_plant_from_config_file('plant_config.json') ``` -------------------------------- ### Importing Array and Mounting Components Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/advanced_topics.rst Imports necessary classes for defining collector arrays and their mounting systems. This is a boilerplate import for working with multiple arrays. ```python from sunpeek.components import Array, MountingFixed from sunpeek.common.unit_uncertainty import Q ``` -------------------------------- ### Skip Cloning New Repositories Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/dev-utils/lines_of_code/loc_doc.rst Use the --no-clone option to prevent the script from cloning any new repositories that are missing locally. ```bash python get_lines_of_code.py --no-clone ``` -------------------------------- ### Programmatic Sensor Mapping with Plant and Array Objects Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/technical_reference/sensor_mapping.rst Map sensors to SunPeek slots programmatically when creating Plant and Array objects. This allows CSV column names to differ from slot names. ```python from sunpeek.components import Plant, Array plant = Plant( name='My Plant', # ... location parameters ... sensor_map={ 'te_amb': 'te_amb', # Maps CSV column 'te_amb' to plant slot 'vf': 'volume_flow', # CSV column name can differ from slot name 'te_in': 'te_in', 'te_out': 'te_out', }, ) array = Array( name='My Array', plant=plant, # ... collector and geometry ... sensor_map={ 'te_in': 'te_in', 'te_out': 'te_out', 'in_global': 'pyranometer_1', }, ) ``` -------------------------------- ### Update SunPeek using Console Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/quick_start/installation/_installation_windows.rst To update SunPeek, open a terminal in the configuration folder, pull the latest images, and then recreate the containers. ```bash docker compose pull ``` ```bash docker compose up -d ``` -------------------------------- ### Configure Power Check Analysis (Formula, Method, Time Range) Source: https://gitlab.com/sunpeek/sunpeek/-/blob/main/docs/source/user_guide/python_tutorial/advanced_topics.rst Explicitly configures the Power Check analysis with a specific formula, averaging method, and an optional time range. The result object will reflect these specified configurations. ```python import pandas as pd result = run_power_check( plant, # Power Check formulas 1/2/3, as specified in ISO 24194:2022 formula=1, # Uses global tilted irradiance (GTI) # formula=2, # Uses beam and diffuse irradiance components separately # formula=3, # For highly concentrating collectors # Averaging methods method='ISO' # Fixed-interval averaging per ISO 24194:2022 # method='Extended' # Moving-average approach with extended interval search # Limit analysis to specific time range eval_start=pd.Timestamp('2017-05-01', tz='UTC'), eval_end=pd.Timestamp('2017-05-02', tz='UTC') ) ```