MHKiT-Software / MHKiT-Python

MHKiT-Python provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
47 stars 45 forks source link

Black Formatting #281

Closed ssolson closed 5 months ago

ssolson commented 7 months ago

This PR adds starts to address formatting issues in MHKiT by adding black:

This PR adds black because it will automatically format our files allowing our users to focus on coding and letting black fix the formatting issues automatically.

To adhere to black formatting developers can install and run black from the terminal manually, they can install black as an extension in their IDE such as VS code, or they can enable enable the pre-commit hook.

What this PR changes:

ssolson commented 5 months ago

@akeeste this is ready for review

akeeste commented 5 months ago

Noting here some non-black related changes, @ssolson add anything else I've missed that you did. We've largely discussed all of these and they aren't issues, but noting for future reference:

ssolson commented 5 months ago

Noting here some non-black related changes, @ssolson add anything else I've missed that you did. We've largely discussed all of these and they aren't issues, but noting for future reference:

  • new API key added for NREL's HSDS server
  • mhkit.tests.river.test_io broken out into mhkit.tests.river.test_io_d3d and mhkit.tests.river.test_io_usgs
  • added functional tests and error handing tests to mhkit.tests.dolfyn.test_tools, mhkit.tests.mooring.test_mooring
  • added error handling tests for mhkit.tests.river.test_resource, mhkit.tests.wave.io.hindcast.test_wind_toolkit, mhkit.tests.wave.test_contours, mhkit.tests.loads.test_loads

Thank you for documenting all these.

ssolson commented 5 months ago
  • with my current MHKiT environment I had some dependency conflicts (jupyter-server and pywinpty) when installing pre-commit. I tried upgrading a those specific packages which broke others (jupyterlab, jupyterlab-server). I have not tried reinstalling everything at once yet. Did you get pre-commit installed okay with the rest of your MHKiT environment?

Adam as I mentioned in the meeting I uninstalled the pre-commit as I found it slow.

I just reinstalled it and I did not get any conflicts. image

akeeste commented 5 months ago
  • with my current MHKiT environment I had some dependency conflicts (jupyter-server and pywinpty) when installing pre-commit. I tried upgrading a those specific packages which broke others (jupyterlab, jupyterlab-server). I have not tried reinstalling everything at once yet. Did you get pre-commit installed okay with the rest of your MHKiT environment?

Adam as I mentioned in the meeting I uninstalled the pre-commit as I found it slow.

I just reinstalled it and I did not get any conflicts. image

That sounds good, thanks for checking. I just wanted to make sure that it could work, even if its slow since we call it out as an option in the readme.

akeeste commented 5 months ago

Once the commented tests are back in this should be good to go! Thanks @ssolson