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

Add ruff linting, formatting and pre-commit hooks #46

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Dec 13, 2023

This pull request addresses Issue #45 by adding the helper files for ruff to implement linting, formatting and pre-commit and CI. This will conform Hercules' coding style to that of FLORIS/FLASC.

Note will need to actually lint the files ahead of merging but waiting for a convenient moment to do all this

@genevievestarke genevievestarke linked an issue Dec 14, 2023 that may be closed by this pull request
@genevievestarke genevievestarke marked this pull request as ready for review December 20, 2023 17:06
@genevievestarke genevievestarke merged commit 1354749 into NREL:develop Dec 20, 2023
0 of 3 checks passed
genevievestarke added a commit that referenced this pull request Dec 20, 2023
* Updating controller to align with WHOC (#41)

* Skeleton for a turbine yaw simulator.

* Implementation mostly in place.

* Simple yaw controller running on dummy. Need to make back compatible.

* Handling case where no yaw simulator specified (or specified as none)

* Removing input_dict.echo from git repo. Can indo if needed.

* Removing previous, more realistic implementation that has not yet been fleshed out.

* Clean up commit.

* Running, but seems theres a timing issue.

* Small updates to installation procedure; also updated intstuctions for running locally.;

* Updates to allow example_06 to run

* Renaming dummy example for clarity.

* Reverting; plan to use one directory only, if possible.

* Runs on eagle and local.

* Revert, take 2.

* Removing old yaw simulator from pysims.

* Removing temporary examples.

* Starting renaming to hercules.

* More name updates.

* Cleaning up, renaming more.

* AMR wind version now runs.

* Removing controller.py in favor of controllers/controller_base.py

* Switching helicsport (not sure if needed?)

* Updates to read in time step.

* Reorganizing emulator somewhat to allow clearer execution of main loop and swap send and receive to AMRwind. Removes KAFKA pieces (were not being used?)

* Commiting to change branch.

* Removing unneded controllers in favor of whoc.

* Emulator controller set up as desired; still tbd where time should come from

* Adding back a pass-through controller in case WHOC not available.

* Replacing controllers/control_base with controller_standin.

* Adding comment about time issue.

* Reinstating nominal yaw control in pass-through.

* Add comments to explain temporary AD connection.

* Copying in old controller code for possible later use.

* Aligning with develop branch.

* Add KAFKA code back in, commented out, in case needed later.

* Changing helicsport to sidestep bug with not connecting on correct port.

* put sim_tim_s_amr_wind in emulator main_dict in init

* Change back to 32000.

---------

Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: Zachary <ztully@nrel.gov>

* Update to public seas (#39) (#43)

* update ci to install seas

* Update install docs

* Add a test of seas and convert to pytest

Co-authored-by: paulf81 <paul.fleming@nrel.gov>

* Feature/battery example (#30)

* Skeleton for a turbine yaw simulator.

* Implementation mostly in place.

* Simple yaw controller running on dummy. Need to make back compatible.

* Handling case where no yaw simulator specified (or specified as none)

* Removing input_dict.echo from git repo. Can indo if needed.

* Removing previous, more realistic implementation that has not yet been fleshed out.

* Clean up commit.

* Running, but seems theres a timing issue.

* Small updates to installation procedure; also updated intstuctions for running locally.;

* Updates to allow example_06 to run

* Renaming dummy example for clarity.

* Reverting; plan to use one directory only, if possible.

* Runs on eagle and local.

* Revert, take 2.

* Removing old yaw simulator from pysims.

* Removing temporary examples.

* Starting renaming to hercules.

* More name updates.

* Cleaning up, renaming more.

* AMR wind version now runs.

* Removing controller.py in favor of controllers/controller_base.py

* Switching helicsport (not sure if needed?)

* Updates to read in time step.

* Reorganizing emulator somewhat to allow clearer execution of main loop and swap send and receive to AMRwind. Removes KAFKA pieces (were not being used?)

* save commit

* zct battery model

* battery example first commit

* Copy over battery example

* git ignore vscode settings

* remove vscode settings

* clean up controller and comments

* small change in high-level controller organization

* generate_amr_standin_data can read amr-wind actuator outputs and moved to tools

* delete unneeded comments

* update battery example branch to match NREL/develop

* Commiting to change branch.

* Removing unneded controllers in favor of whoc.

* Emulator controller set up as desired; still tbd where time should come from

* Adding back a pass-through controller in case WHOC not available.

* Replacing controllers/control_base with controller_standin.

* Adding comment about time issue.

* Reinstating nominal yaw control in pass-through.

* small change in batch script

* save before merging emulator from Misha's branch

* whoc battery controller

* troubleshooting WHOC format battery controller

* delete obsolete control_methods folder

* delete duplicate lines

* delete unused controller import

* add exmple 06 readme file for amr standin data instructions

* fix example 06 jupyter notebook

---------

Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: misha <misi9170@colorado.edu>
Co-authored-by: Zachary <ztully@nrel.gov>

* Stand-in AMR-wind uses stop time defined in amr_input.inp (#47)

* Set stand-in stop time from amr_input file.

* Controlling amr standin stop time via endtime rather than absolute_helics_time.

* Setting stop_time to 100.0 to mimic earlier behavior.

* Updating stop times in other dummy amr_input files.

---------

Co-authored-by: misi9170 <msinner@nrel.gov>

* Improved PV solar model (#58)

* created dummy example for amr wind dummy + solar

* final commit before creating feature branch

* standalone solar pysam example

* working standalone example of solar pysam model

* removed time as explicit input in step

* working example of solar pysam and hercules (but pysam has a bug)

* changing hardcoded stoptime of 100 s to 1000 s to demo solar module

* cleaning before pull request review of misha's changes

* working solar pysam example with test amr wind

* adding updated results in jupyter notebook

* trying to run after git pull of develop

* solar model runs successfully, but there is a time issue

* correcting irradiance field and removing unnecessary comments

* removing unnecessary files

* removing test amr wind and solar example, saving for separate PR

* adding environment yaml file needed for pysam

* updating setup and docs to include pysam and restrict python version

* adding missing csv weather file

* Minor changes for running the code

* Minor cleanup in example.

* remove environment.yml

---------

Co-authored-by: Genevieve Starke <Genevieve.Starke@nrel.gov>
Co-authored-by: misi9170 <michael.sinner@nrel.gov>

* Fix documentation download command

* Feature/rename dummyamr (#48)

* Renaming AMR dummy to AMR standin

* Delete previous example 02

* Ignoring logstandin.

* A few extra references in text.

* Renaming solar updates.

---------

Co-authored-by: misi9170 <msinner@nrel.gov>

* Add WHOC installation instructions to Hercules documentation (#59)

* Add WHOC installation instructions to Hercules documentation

* Add note about develop branch on WHOC

* Fix cd command

* Add ruff and pre-commit files (#46)

* Feature/add ruff (#60)

* Ruff changes and updates to CI

* Ruff reformatting changes

* py_sims_test update

* Final ruff edits to files

---------

Co-authored-by: Paul <paul.fleming@nrel.gov>
Co-authored-by: misi9170 <39596329+misi9170@users.noreply.github.com>
Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: Zachary <ztully@nrel.gov>
Co-authored-by: Zachary Tully <107644545+ZackTully@users.noreply.github.com>
Co-authored-by: misha <misi9170@colorado.edu>
Co-authored-by: Brooke Stanislawski <34248707+brookeslawski@users.noreply.github.com>
Co-authored-by: misi9170 <michael.sinner@nrel.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ruff linting, formatting and pre-commit
2 participants