Skip to content

Commit

Permalink
add flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-salles committed Jun 20, 2024
1 parent 997500e commit 525a9af
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503, F403, F401
max-line-length = 89
max-complexity = 18
select = B,C,E,F,W,T4,B9
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"mesonbuild.configureOnOpen": true,
"C_Cpp.default.compileCommands": "/Users/galois/codes/gospl/builddir/compile_commands.json",
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild"
}
10 changes: 2 additions & 8 deletions docs/api_ref/flow_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ Class FAMesh

~FAMesh.flowAccumulation
~FAMesh.matrixFlow
~FAMesh.riverIncision

.. rubric:: Private Methods

.. autosummary::

~FAMesh._buildFlowDirection
~FAMesh._distanceCoasts
~FAMesh._distributeDownstream
~FAMesh._getErosionRate
~FAMesh._globalCoastsTree
~FAMesh._getEroDepRatex
~FAMesh._matrix_build
~FAMesh._matrix_build_diag
~FAMesh._solve_KSP
Expand All @@ -39,17 +36,14 @@ Public functions

.. automethod:: flow.flowplex.FAMesh.flowAccumulation
.. automethod:: flow.flowplex.FAMesh.matrixFlow
.. automethod:: flow.flowplex.FAMesh.riverIncision


Private functions
---------------------

.. automethod:: flow.flowplex.FAMesh._buildFlowDirection
.. automethod:: flow.flowplex.FAMesh._distanceCoasts
.. automethod:: flow.flowplex.FAMesh._distributeDownstream
.. automethod:: flow.flowplex.FAMesh._getErosionRate
.. automethod:: flow.flowplex.FAMesh._globalCoastsTree
.. automethod:: flow.flowplex.FAMesh._getEroDepRate
.. automethod:: flow.flowplex.FAMesh._matrix_build
.. automethod:: flow.flowplex.FAMesh._matrix_build_diag
.. automethod:: flow.flowplex.FAMesh._solve_KSP
2 changes: 0 additions & 2 deletions docs/api_ref/in_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Class ReadYaml
~ReadYaml._addTime
~ReadYaml._defineRain
~ReadYaml._defineTectonic
~ReadYaml._extraCompaction
~ReadYaml._extraDomain
~ReadYaml._readCompaction
~ReadYaml._readDomain
Expand All @@ -40,7 +39,6 @@ Private functions
.. automethod:: tools.inputparser.ReadYaml._addTime
.. automethod:: tools.inputparser.ReadYaml._defineRain
.. automethod:: tools.inputparser.ReadYaml._defineTectonic
.. automethod:: tools.inputparser.ReadYaml._extraCompaction
.. automethod:: tools.inputparser.ReadYaml._extraDomain
.. automethod:: tools.inputparser.ReadYaml._readCompaction
.. automethod:: tools.inputparser.ReadYaml._readDomain
Expand Down
12 changes: 0 additions & 12 deletions docs/api_ref/sea_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ Class SEAMesh

.. autosummary::

~SEAMesh._diffuseOcean
~SEAMesh._distanceCoasts
~SEAMesh._distOcean
~SEAMesh._evalFunction
~SEAMesh._evalJacobian
~SEAMesh._getSeaVol
~SEAMesh._globalCoastsTree
~SEAMesh._matOcean

Public functions
---------------------
Expand All @@ -41,11 +35,5 @@ Public functions
Private functions
---------------------

.. automethod:: sed.seaplex.SEAMesh._diffuseOcean
.. automethod:: sed.seaplex.SEAMesh._distanceCoasts
.. automethod:: sed.seaplex.SEAMesh._distOcean
.. automethod:: sed.seaplex.SEAMesh._evalFunction
.. automethod:: sed.seaplex.SEAMesh._evalJacobian
.. automethod:: sed.seaplex.SEAMesh._getSeaVol
.. automethod:: sed.seaplex.SEAMesh._globalCoastsTree
.. automethod:: sed.seaplex.SEAMesh._matOcean
2 changes: 0 additions & 2 deletions docs/api_ref/sed_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Class SEDMesh
.. autosummary::

~SEDMesh._distributeSediment
~SEDMesh._getSedVol
~SEDMesh._hillSlope
~SEDMesh._moveDownstream
~SEDMesh._updateSinks
Expand All @@ -43,7 +42,6 @@ Private functions
---------------------

.. automethod:: sed.sedplex.SEDMesh._distributeSediment
.. automethod:: sed.sedplex.SEDMesh._getSedVol
.. automethod:: sed.sedplex.SEDMesh._hillSlope
.. automethod:: sed.sedplex.SEDMesh._moveDownstream
.. automethod:: sed.sedplex.SEDMesh._updateSinks
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ def __getattr__(cls, name):
"scipy.interpolate",
"vtk",
"vtk.util",
"gflex",
"xarray",
]

for m in MOCK_MODULES:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ goSPL documentation
`Source Repository <https://github.com/Geodels/gospl>`__ |
`Issues & Ideas <https://github.com/Geodels/gospl/issues>`__

**goSLP** (short for ``Global Scalable Paleo Landscape Evolution`` and pronounced: **/ˈɡospel/**, **[ˈɡo̞s̠pe̞l]**) is an open source, GPL-licensed library providing a scalable parallelised Python-based numerical model to simulate landscapes and basins reconstruction at global scale. goSPL is developed by the `EarthCodeLab Group <https://earthcolab.org>`_ at the University of Sydney.
**goSPL** (short for ``Global Scalable Paleo Landscape Evolution``) is an open source, GPL-licensed library providing a scalable parallelised Python-based numerical model to simulate landscapes and basins reconstruction at global scale. goSPL is developed by the `EarthCodeLab Group <https://earthcolab.org>`_ at the University of Sydney.


Statement of need
Expand Down
5 changes: 3 additions & 2 deletions gospl/tools/cgflex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import petsc4py
import numpy as np

# import rioxarray
import xarray as xr
from mpi4py import MPI
from pathlib import Path
from gflex.f2d import F2D
from time import process_time

if "READTHEDOCS" not in os.environ:
from gflex.f2d import F2D

petsc4py.init(sys.argv)
MPIrank = petsc4py.PETSc.COMM_WORLD.Get_rank()
MPIsize = petsc4py.PETSc.COMM_WORLD.Get_size()
Expand Down
6 changes: 4 additions & 2 deletions gospl/tools/inputparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import petsc4py
import numpy as np
import pandas as pd
from ruamel.yaml import YAML

from operator import itemgetter
from scipy.interpolate import interp1d

if "READTHEDOCS" not in os.environ:
from ruamel.yaml import YAML
from scipy.interpolate import interp1d

petsc4py.init(sys.argv)
MPIrank = petsc4py.PETSc.COMM_WORLD.Get_rank()
Expand Down

0 comments on commit 525a9af

Please sign in to comment.