Skip to content

Commit

Permalink
Merge pull request #6 from NREL/dev
Browse files Browse the repository at this point in the history
Merging dev changes to main
  • Loading branch information
eyoung55 authored May 2, 2023
2 parents 7774ae3 + 0b23a31 commit 99c8d59
Show file tree
Hide file tree
Showing 109 changed files with 3,470 additions and 4,011 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/test_pvade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: test_pvade

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Job 1 of 2 - run pytest on code
pytest:
name: Pytest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Build Conda environment
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yaml
- name: Run pytest
shell: bash -l {0}
run: pytest -sv pvade/tests/

# Job 2 of 2 - enforce Black formatting
formatting:
name: Black formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.*
!/.gitignore
!/.readthedocs.yaml
*.pyc
*.egg-info/

docs/_build/
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .readthedocs.yaml

version: 2

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"

sphinx:
configuration: docs/conf.py

conda:
environment: environment.yaml
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# PVOPT
This project will develop an open source fluid-structure interaction model which can be used as part of a modeling chain to provide stressor inputs to mechanical module models to study the physics of failure for degradation mechanisms such as cell cracking, weathering of cracked cells, and glass breakage.
# PVade

https://github.nrel.gov/pages/warsalan/PVOPT/
`PVade` is an open source fluid-structure interaction model which can be used to study wind loading and stability on solar-tracking PV arrays. `PVade` can be used as part of a larger modeling chain to provide stressor inputs to mechanical module models to study the physics of failure for degradation mechanisms such as cell cracking, weathering of cracked cells, and glass breakage. For more information, visit the [PVade Documentation](TODO).

[![test_pvade](https://github.com/NREL/PVade/actions/workflows/test_pvade.yaml/badge.svg)](https://github.com/NREL/PVade/actions/workflows/test_pvade.yaml)

## Getting Started

New users are encouraged to review the [Getting Started](TODO) guide which describes how to create the Conda environment and run the example simulations.

## Developer Quick Start

# Getting Started
1. To use this software, begin by creating a Conda environment using the provided `environment.yaml` file:
```bash
conda env create -n my_env_name -f environment.yaml
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20 changes: 20 additions & 0 deletions docs/background/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Background
==========

A collection of resources for further reading on PVade topics and the theory and implementation for solver elements.

Fluid Solver
------------



Structural Solver
-----------------



PV Wind Loading and Stability
-----------------------------

* E. Young, "Predicting wind loading and instability in solar tracking PV arrays", PV Reliability Workshop (2023), https://www.nrel.gov/docs/fy23osti/85567.pdf.

59 changes: 59 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath("../pvade"))


# -- Project information -----------------------------------------------------

project = "PVade"
copyright = "2023, Walid Arsalane, Ethan Young"
author = "Walid Arsalane, Ethan Young"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

autoclass_content = "both"
23 changes: 23 additions & 0 deletions docs/how_to_guides/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Getting Started
===============

Building Conda Environment
--------------------------

To use this software, begin by creating a Conda environment using the provided ``environment.yaml`` file::

conda env create -n my_env_name -f environment.yaml

where ``my_env_name`` can be replaced with a short name for your Conda environment. When the environment finishes installing, activate it with::

conda activate my_env_name

from within your activate Conda environment, a simulation can be executed with::

python main.py --command_line_arg value


Running Examples
----------------

.. Fill in with walkthrough pointing to an example
4 changes: 4 additions & 0 deletions docs/how_to_guides/hpc_jobs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HPC Jobs
========

.. Fill in with walkthrough pointing to an example
8 changes: 8 additions & 0 deletions docs/how_to_guides/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
How To Guides
=============

.. toctree::
:maxdepth: 1

getting_started
hpc_jobs
30 changes: 30 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. PVade documentation master file, created by
sphinx-quickstart on Fri Mar 10 11:27:06 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to PVade's documentation!
=================================

PVade is an open source fluid-structure interaction model which can be used to study wind loading and stability on solar-tracking PV arrays. PVade can be used as part of a larger modeling chain to provide stressor inputs to mechanical module models to study the physics of failure for degradation mechanisms such as cell cracking, weathering of cracked cells, and glass breakage.

Organization
------------

Documentation is currently organized into three main categories:

* :ref:`How to Guides`: User guides covering basic topics and use cases for the PVade software
* :ref:`Technical Reference`: Programming details on the PVade API and functions
* :ref:`Background`: Information and research sources for fluid and structural solvers and PV topics

New users may find it helpful to review the :ref:`Getting Started` materials first.

Contents
--------

.. toctree::
:maxdepth: 2

how_to_guides/index
technical_reference/index
background/index
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
6 changes: 6 additions & 0 deletions docs/technical_reference/data_stream.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DataStream
==========

.. automodule:: pvade.DataStream
:members:
:private-members:
6 changes: 6 additions & 0 deletions docs/technical_reference/domain_creation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DomainCreation
==============

.. automodule:: pvade.geometry.template.TemplateDomainCreation
:members:
:private-members:
6 changes: 6 additions & 0 deletions docs/technical_reference/domain_creation_panels.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DomainCreationPanels
====================

.. automodule:: pvade.geometry.panels.DomainCreation
:members:
:private-members:
6 changes: 6 additions & 0 deletions docs/technical_reference/flow_manager.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FlowManager
===========

.. automodule:: pvade.FlowManager
:members:
:private-members:
14 changes: 14 additions & 0 deletions docs/technical_reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Technical Reference
===================

.. toctree::
:maxdepth: 1

parameters
data_stream
domain_creation_panels
domain_creation
mesh_manager
mesh_manager_2d
mesh_manager_3d
flow_manager
6 changes: 6 additions & 0 deletions docs/technical_reference/mesh_manager.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MeshManager
===========

.. automodule:: pvade.geometry.MeshManager
:members:
:private-members:
6 changes: 6 additions & 0 deletions docs/technical_reference/mesh_manager_2d.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MeshManager2D
=============

.. automodule:: pvade.geometry.MeshManager2d
:members:
:private-members:
6 changes: 6 additions & 0 deletions docs/technical_reference/mesh_manager_3d.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MeshManager3d
=============

.. automodule:: pvade.geometry.MeshManager3d
:members:
:private-members:
6 changes: 6 additions & 0 deletions docs/technical_reference/parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Parameters
==========

.. automodule:: pvade.Parameters
:members:
:private-members:
7 changes: 5 additions & 2 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pvopt-env
name: pvade
channels:
- conda-forge
- defaults
Expand All @@ -10,13 +10,16 @@ dependencies:
- jsonschema
- jupyter
- matplotlib
- meshio
- pandas
- pytest
- python-gmsh
- pyyaml
- scipy
- snakeviz
- sphinx
- tqdm
- pip
- pip:
- -e . # Installs the pvopt package
- sphinx-rtd-theme
- -e . # Installs the pvade package
Loading

0 comments on commit 99c8d59

Please sign in to comment.