diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5ecb4fb..f219f4d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,44 +7,32 @@ jobs: run-pymm-local: permissions: contents: read - pull-requests: write timeout-minutes: 30 - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - uses: actions/checkout@v5 - - name: Set up Python 3.14 - uses: actions/setup-python@v2 - with: - python-version: 3.14 - - - name: Install OpenFOAM + - name: Install OpenFOAM and gmsh run: | sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key > /etc/apt/trusted.gpg.d/openfoam.asc" - sudo add-apt-repository http://dl.openfoam.org/ubuntu - sudo apt-get update - sudo apt -y install openfoam14 - - - name: Install gmsh - run: | + sudo add-apt-repository "http://dl.openfoam.org/ubuntu main dev" + sudo sed -i "s/^\(deb\).*\(http\)/\1 [arch=amd64] \2/" /etc/apt/sources.list.d/*dl_openfoam_org*list sudo apt-get update - sudo apt-get -y install gmsh + sudo apt -y install openfoam14 gmsh - - name: Install test dependecies + - name: Install pymm and python requirements run: | + python3.14 -m venv vpymm + . vpymm/bin/activate + echo "$PWD/vpymm/bin" >> $GITHUB_PATH pip install --upgrade pip setuptools wheel - pip install -r dev-requirements.txt - - - name: Install pymm - run: | pip install . + pip install -r dev-requirements.txt - name: Check code style and linting run: | - black --target-version py312 src/ tests/ --check + black --target-version py314 src/ tests/ --check pylint src/ tests/ ruff check src/ tests/ mypy --ignore-missing-imports src/ tests/ @@ -59,4 +47,4 @@ jobs: - name: Build documentation run: | pushd docs - make html + make html SPHINXOPTS="-W" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a8385b..e1f4600 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,13 +13,13 @@ Contributions are more than welcome using the fork and pull request approach 1. Work on your own fork of the main repo 1. In the main repo execute: 1. **pip install -r dev-requirements.txt** (this installs the [_dev-requirements.txt_](https://github.com/cssr-tools/pymm/blob/main/dev-requirements.txt)) - 1. **black --target-version py312 src/ tests/** (this formats the code) + 1. **black --target-version py314 src/ tests/** (this formats the code) 1. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request) 1. **ruff check src/ tests/** (this also analyses the code, and might rise issues that need to be fixed before the pull request) 1. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request) 1. **pytest --cov=pymm --cov-report term-missing tests/ -n auto** (this runs locally the tests, and might rise issues that need to be fixed before the pull request) 1. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the [_docs_](https://github.com/cssr-tools/pymm/tree/main/docs) folder) - * Tip: See the [_CI.yml_](https://github.com/cssr-tools/pymm/blob/main/.github/workflows/CI.yml) script and the [_Actions_](https://github.com/cssr-tools/pymm/actions) for installation of _pymm_, as well as the execution of the six previous steps in Ubuntu 24.04 using Python 3.12. + * Tip: See the [_CI.yml_](https://github.com/cssr-tools/pymm/blob/main/.github/workflows/CI.yml) script and the [_Actions_](https://github.com/cssr-tools/pymm/actions) for installation of _pymm_, as well as the execution of the six previous steps in Ubuntu 26.04 using Python 3.14. 1. Squash your commits into a single commit (see this [_nice tutorial_](https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa) if you are not familiar with this) 1. Push your commit and make a pull request 1. The maintainers will review the pull request, and if the contribution is accepted, then it will be merge to the main repo diff --git a/docs/_sources/contributing.rst.txt b/docs/_sources/contributing.rst.txt index 0bc74e7..296bc25 100644 --- a/docs/_sources/contributing.rst.txt +++ b/docs/_sources/contributing.rst.txt @@ -22,7 +22,7 @@ Contribute to the software #. In the main repo execute: #. **pip install -r dev-requirements.txt** (this installs the `dev-requirements.txt `_) - #. **black \-\-target-version py312 src/ tests/** (this formats the code) + #. **black \-\-target-version py314 src/ tests/** (this formats the code) #. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request) #. **ruff check src/ tests/** (this also analyses the code, and might rise issues that need to be fixed before the pull request) #. **mypy \-\-ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request) @@ -30,7 +30,7 @@ Contribute to the software #. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs `_ folder) .. tip:: - See the `CI.yml `_ script and the `Actions `_ for installation of pymm, as well as the execution of the six previous steps in Ubuntu 24.04. + See the `CI.yml `_ script and the `Actions `_ for installation of pymm, as well as the execution of the six previous steps in Ubuntu 26.04 and Python 3.14. #. Squash your commits into a single commit (see this `nice tutorial `_ if you are not familiar with this) #. Push your commit and make a pull request diff --git a/docs/_sources/installation.rst.txt b/docs/_sources/installation.rst.txt index b737495..b0ba1e9 100644 --- a/docs/_sources/installation.rst.txt +++ b/docs/_sources/installation.rst.txt @@ -45,7 +45,7 @@ install the Python requirements in a virtual environment with the following comm OpenFOAM -------- -See the `OpenFOAM page `_, where from OpenFOAM-12 the simulator is available via apt get, +See the `OpenFOAM page `_, where from OpenFOAM-12 the simulator is available via apt get, and OpenFOAM-14 is the latest release. To test if OpenFoam is installed and working, you could type in the terminal: .. code-block:: console @@ -62,4 +62,4 @@ See the `Gmsh page `_. .. tip:: See the `CI.yml `_ script - for installation of pymm, gmsh, and OpenFOAM-14 in Ubuntu using Python 3.14. + for installation of pymm, gmsh, and OpenFOAM-14 in Ubuntu 26.04 using Python 3.14. diff --git a/docs/contributing.html b/docs/contributing.html index 005f200..1f14de7 100644 --- a/docs/contributing.html +++ b/docs/contributing.html @@ -107,7 +107,7 @@

Contribute to the software
  • pip install -r dev-requirements.txt (this installs the dev-requirements.txt)

  • -
  • black --target-version py312 src/ tests/ (this formats the code)

  • +
  • black --target-version py314 src/ tests/ (this formats the code)

  • pylint src/ tests/ (this analyses the code, and might rise issues that need to be fixed before the pull request)

  • ruff check src/ tests/ (this also analyses the code, and might rise issues that need to be fixed before the pull request)

  • mypy --ignore-missing-imports src/ tests/ (this is a static checker, and might rise issues that need to be fixed before the pull request)

  • @@ -116,7 +116,7 @@

    Contribute to the software

    Tip

    -

    See the CI.yml script and the Actions for installation of pymm, as well as the execution of the six previous steps in Ubuntu 24.04.

    +

    See the CI.yml script and the Actions for installation of pymm, as well as the execution of the six previous steps in Ubuntu 26.04 and Python 3.14.

    diff --git a/docs/installation.html b/docs/installation.html index 0ffe05e..d02a352 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -123,7 +123,7 @@

    Python package

    OpenFOAM

    -

    See the OpenFOAM page, where from OpenFOAM-12 the simulator is available via apt get, +

    See the OpenFOAM page, where from OpenFOAM-12 the simulator is available via apt get, and OpenFOAM-14 is the latest release. To test if OpenFoam is installed and working, you could type in the terminal:

    source /opt/openfoam14/etc/bashrc
     foamRun -help
    @@ -136,7 +136,7 @@ 

    Gmsh<

    Tip

    See the CI.yml script -for installation of pymm, gmsh, and OpenFOAM-14 in Ubuntu using Python 3.14.

    +for installation of pymm, gmsh, and OpenFOAM-14 in Ubuntu 26.04 using Python 3.14.

    diff --git a/docs/searchindex.js b/docs/searchindex.js index 1c4b386..35acc6b 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles":{"About pymm":[[0,null]],"Configuration file":[[2,null]],"Contribute to the software":[[3,"contribute-to-the-software"]],"Contributing":[[3,null]],"Description":[[7,"description"]],"Device":[[4,"device"]],"Examples":[[4,null]],"Figure- and device-related parameters":[[2,"figure-and-device-related-parameters"]],"Gmsh":[[6,"gmsh"]],"Ground Rules":[[3,"ground-rules"]],"Image":[[4,"image"]],"Image-related parameters":[[2,"image-related-parameters"]],"Indices and tables":[[5,"indices-and-tables"]],"Installation":[[6,null]],"Introduction":[[7,null]],"Mesh-related parameters":[[2,"mesh-related-parameters"]],"Module contents":[[10,"module-pymm"],[11,"module-pymm.core"]],"Online":[[4,"online"]],"OpenFOAM":[[6,"openfoam"]],"Output folder":[[9,null]],"Overview":[[7,"overview"]],"Python package":[[6,"python-package"]],"Related":[[13,null]],"Remaining parameters":[[2,"remaining-parameters"]],"Reporting issues or problems":[[3,"reporting-issues-or-problems"]],"Seek support":[[3,"seek-support"]],"Submodules":[[11,"submodules"]],"Subpackages":[[10,"subpackages"]],"Welcome to pymm\u2019s documentation!":[[5,null]],"ad-micp":[[13,"ad-micp"]],"expreccs":[[13,"expreccs"]],"plopm":[[13,"plopm"]],"pofff":[[13,"pofff"]],"pycopm":[[13,"pycopm"]],"pymm":[[1,"pymm"],[8,null]],"pymm Python API":[[1,null]],"pymm package":[[10,null]],"pymm.core package":[[11,null]],"pymm.core.pymm module":[[12,null]],"pyopmnearwell":[[13,"pyopmnearwell"]],"pyopmspe11":[[13,"pyopmspe11"]]},"docnames":["about","api","configuration_file","contributing","examples","index","installation","introduction","modules","output_folder","pymm","pymm.core","pymm.core.pymm","related"],"envversion":{"sphinx":66,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2},"filenames":["about.rst","api.rst","configuration_file.rst","contributing.rst","examples.rst","index.rst","installation.rst","introduction.rst","modules.rst","output_folder.rst","pymm.rst","pymm.core.rst","pymm.core.pymm.rst","related.rst"],"indexentries":{},"objects":{"":[[10,0,0,"-","pymm"]],"pymm":[[11,0,0,"-","core"]],"pymm.core":[[12,0,0,"-","pymm"]],"pymm.core.pymm":[[12,1,1,"","PymmConfig"],[12,3,1,"","_assign_boundary"],[12,3,1,"","boundary_tags_left_top"],[12,3,1,"","boundary_tags_right_bottom"],[12,3,1,"","copy_and_replace"],[12,3,1,"","extract_borders"],[12,3,1,"","main"],[12,3,1,"","make_figures"],[12,3,1,"","pad_with"],[12,3,1,"","process_image"],[12,3,1,"","run_stokes"],[12,3,1,"","run_tracer"],[12,3,1,"","write_geo"]],"pymm.core.pymm.PymmConfig":[[12,2,1,"","borderTol"],[12,2,1,"","channelWidth"],[12,2,1,"","diffusion"],[12,2,1,"","grainMeaning"],[12,2,1,"","grainsSize"],[12,2,1,"","grainsTol"],[12,2,1,"","inletLocation"],[12,2,1,"","inletValue"],[12,2,1,"","iterationsMax"],[12,2,1,"","length"],[12,2,1,"","lineWidth"],[12,2,1,"","meshSize"],[12,2,1,"","pressureConv"],[12,2,1,"","rescale"],[12,2,1,"","thickness"],[12,2,1,"","threshold"],[12,2,1,"","tracerStep"],[12,2,1,"","tracerTime"],[12,2,1,"","tracerWrite"],[12,2,1,"","velocityConv"],[12,2,1,"","viscosity"],[12,2,1,"","width"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:function"},"terms":{"03e":2,"0e":[2,4],"1068x1068":4,"1c":2,"1e":[2,4],"2a":4,"2d":2,"2e":2,"3d":2,"5e":2,"600e":4,"6e":4,"74e":2,"805x252":2,"8e":[2,4],"A":13,"About":5,"An":[3,13],"As":0,"Below":13,"For":[0,2,6],"Here":4,"If":6,"In":[3,4],"NO":4,"On":2,"The":[0,1,2,3,4,6,7,9],"Then":[2,4,9],"There":2,"This":[2,7],"To":6,"We":[2,3],"While":6,"_assign_boundari":[10,11,12],"_build":3,"_iaxi":12,"accept":3,"action":3,"activ":6,"ad":[4,5],"add":[4,12],"addit":9,"al":4,"allow":2,"also":3,"altern":3,"alway":2,"anaconda":6,"analys":3,"ani":[3,12],"anoth":2,"answer":3,"api":5,"appli":7,"applic":2,"approach":[0,3],"approxim":[2,4],"approximate_polygon":2,"apt":6,"argument":7,"assign":12,"assum":4,"auto":3,"avail":[4,6],"base":[0,7,12,13],"bashrc":6,"bb":12,"bc":[2,4],"bdnb":12,"bdnl":12,"bdnr":12,"bdnt":12,"befor":3,"benali2019":2,"benchmark":13,"bin":6,"binari":[2,4],"bl":12,"black":[2,3,4],"bool":12,"border":[2,4,12],"bordertol":[2,4,11,12],"bottom":[2,4,12],"boundari":[4,7,12],"boundary_tags_left_top":[10,11,12],"boundary_tags_right_bottom":[10,11,12],"br":12,"bt":12,"build":[3,4],"built":4,"ca":4,"calcit":13,"call":9,"can":[2,3,6],"case":[2,4],"cd":6,"center":0,"central":12,"cfg":12,"chang":[3,9],"channel":[2,4],"channelwidth":[2,4,11,12],"check":[3,13],"checker":3,"checkout":6,"ci":[3,6],"class":12,"clone":6,"cluster":[2,4],"cn_border":12,"cn_grain":12,"co2":13,"code":[3,6,10],"coeffici":[2,4],"collabor":3,"color":[2,4],"com":[6,7],"command":[4,6],"commit":3,"comput":[0,2],"concentr":4,"condit":[2,4],"configur":[4,5,7,12],"consid":[2,4,7],"consist":2,"contain":[1,4],"content":[1,3,5,8],"contour":[2,4,12],"contribut":[0,5,6],"control":2,"converg":[2,4],"convert":[2,4],"coordinate_index":12,"copi":3,"copy_and_replac":[10,11,12],"core":[1,8,10],"corner":4,"correspond":[2,4],"cov":3,"creat":[2,3,6],"criteria":[2,4],"criterium":[2,4],"cross":2,"csp":13,"cssr":[6,7],"current":[2,7,9],"dark":[2,4],"de":2,"decreas":2,"default":[4,7],"defin":2,"depend":6,"depth":[2,4],"describ":[3,4,7],"descript":5,"detail":2,"dev":[3,6],"develop":6,"devic":[5,7],"dict":12,"differ":2,"diffus":[2,4,11,12],"dimens":2,"direct":9,"dmar":4,"doc":[3,12],"document":[3,7,9],"domain":7,"dst":12,"dynam":[0,2,4,13],"e":[2,4,6,7,9],"easili":7,"edg":6,"edit":12,"element":2,"em":13,"email":3,"end":[2,4],"entri":[2,4],"environ":6,"et":4,"etc":[2,6],"exampl":[2,5],"exectu":4,"execut":[1,2,3,4,6,7,9],"exprecc":5,"extend":[2,3,7],"extra":12,"extract":[2,4,12],"extract_bord":[10,11,12],"factor":[2,4],"familiar":3,"featur":0,"field":7,"fig":[2,4],"figur":[4,5,7,12],"file":[1,3,4,5,7,9,12],"first":2,"fix":3,"flag":4,"float":12,"float64":12,"flow":[4,7,12,13],"flow_trac":7,"fluid":[0,2,4],"fluid_dens":[2,4],"fluidflow":13,"foamrun":6,"fol":12,"folder":[1,3,4,5,6,7],"follow":[2,4,6,7,9],"fork":[0,3],"format":3,"found":2,"framework":[4,7,13],"full":7,"function":12,"fund":0,"g":[2,4,6,7,9],"gave":4,"general":7,"generat":[2,3,7,9,12,13],"geo":12,"geolog":13,"geometri":[2,7],"get":[3,6],"gif":13,"git":6,"github":[3,4,6,7],"gmsh":[4,5,7,12],"grain":[2,4,7,12],"grainmean":[2,4,11,12],"grainssiz":[2,4,11,12],"grainstol":[2,4,11,12],"gray":2,"greater":2,"grid":2,"ground":5,"height":[2,4],"help":[3,6],"higher":2,"histori":13,"home":4,"host":7,"howev":2,"html":[3,12],"https":[6,7,12],"ignor":3,"im":12,"imag":[0,5,7,12,13],"imh":12,"iml":12,"implement":[2,7],"import":3,"in_imag":12,"includ":[2,9],"increas":2,"index":5,"induc":13,"inject":2,"inlet":[2,4],"inletloc":[2,4,11,12],"inletvalu":[2,4,11,12],"input":[2,4,12],"insid":6,"instal":[3,5],"int":12,"interest":[4,6,13],"internal":2,"interval":[2,4],"introduct":5,"issu":[0,5],"iter":[2,4],"iterationsmax":[2,4,11,12],"joekar":4,"keep":7,"kg":[2,4],"kinemat":[2,4],"kwarg":12,"l":6,"later":12,"latest":6,"leakag":13,"left":[2,4,12],"length":[2,4,11,12],"let":2,"light":[2,4],"line":[2,3,4],"linewidth":[2,4,11,12],"link":2,"lint":6,"linux":6,"list":12,"liu2022":2,"local":3,"locat":[1,2,4],"look":[2,3],"m":[2,4,6,7],"m2":[2,4],"m3":[2,4],"main":[1,3,10,11,12],"maintain":3,"make":[3,12],"make_figur":[10,11,12],"mako":[1,2],"mamba":6,"manag":6,"mantain":3,"match":13,"mathemat":2,"maximum":[2,4],"mean":2,"measur":2,"merg":3,"mesh":[4,5,7],"mesh_flow":7,"meshsiz":[2,4,11,12],"micp":5,"microbi":13,"micromodel":[2,4],"microsystem":[2,4,7,12],"middl":[2,4],"might":[3,6,13],"miniforg":6,"minimum":[2,4],"minut":4,"miss":3,"mode":[2,7,12],"model":[2,13],"modifi":[2,6,9],"modul":[1,5,8,13],"morpholog":2,"much":2,"mypi":3,"n":3,"name":[4,7],"navier":12,"ndarray":12,"near":13,"need":3,"new":[0,2,3],"next":2,"niasar":4,"nice":[2,3],"none":12,"norc":0,"norceresearch":4,"now":4,"number":[0,2,4],"number_of_seg":12,"numer":[2,4,7,9],"numpi":12,"o":7,"object":12,"one":[2,4,9],"onli":[2,7],"onlin":[2,5],"open":13,"openfoam":[2,5,7,9,12],"openfoam14":6,"opm":13,"opt":6,"option":7,"org":12,"output":[2,5,7],"overview":5,"p":[4,7],"pa":[2,4],"packag":[0,1,5,7,8],"pad":12,"pad_width":12,"pad_with":[10,11,12],"page":[3,4,5,6],"paramet":[4,5,7,9],"paraview":9,"pat":12,"path":[4,7,12],"pattern":2,"pb":12,"perform":7,"pip":[3,6],"pixel":[2,4],"pl":12,"pleas":[0,3],"plopm":5,"png":[4,7],"pngs":[7,13],"pofff":5,"point":[2,12],"polygon":[2,4],"pore":2,"possibl":3,"pr":12,"precipit":13,"prefer":3,"present":2,"pressur":[2,4],"pressureconv":[2,4,11,12],"previous":[3,4],"problem":5,"process":12,"process_imag":[10,11,12],"produc":[2,4],"project":[0,13],"prs":3,"pt":12,"pull":[0,3],"push":3,"pushd":3,"py312":3,"pycopm":5,"pylint":3,"pymm":[2,3,4,6,7,9],"pymmconfig":[10,11,12],"pyopmnearwel":5,"pyopmspe11":5,"pytest":3,"python":[0,5,7,12,13],"python3":6,"quad":2,"quick":13,"r":[3,6],"rais":[0,3],"reach":[2,4],"real":2,"reduc":2,"refer":[2,12],"reference_valu":12,"region":13,"relat":[4,5,9],"releas":6,"reli":7,"remain":5,"remark":2,"remedi":13,"remove_small_object":2,"replac":[3,12],"repo":[3,6],"report":5,"repositori":[3,6],"request":[0,3],"requir":[3,6],"rescal":[2,4,11,12],"research":0,"reservoir":13,"resolut":2,"resourc":[0,2],"respect":2,"result":[2,4,9],"review":3,"right":[2,4,12],"rise":3,"ruff":3,"rule":5,"run":[2,3,4,7,9,12],"run_stok":[10,11,12],"run_trac":[10,11,12],"s":[2,4],"save":[4,9],"scalartransportfoam":2,"scale":2,"scheme":[2,4,9],"screenshot":[4,9],"script":[1,3,6,12],"search":5,"section":4,"see":[2,3,6,9,12],"seek":5,"segment":7,"select":9,"send":3,"set":[2,4],"setup":4,"setuptool":6,"shape":2,"show":[2,4,9],"side":2,"simpl":7,"simplefoam":2,"simul":[2,4,6,7,9,12,13],"sinc":4,"singl":3,"site":13,"six":3,"size":[2,4],"skimag":[2,7],"skip":6,"slip":2,"smaller":2,"softwar":5,"solut":[2,4],"solver":[2,4,7,9],"soon":3,"sourc":[4,6,13],"space":2,"spatial":7,"spe11":13,"specif":6,"squash":3,"src":[3,12],"stabl":12,"start_index":12,"static":3,"step":[2,3,4,6],"stoke":[2,4,12],"storag":13,"str":12,"studi":13,"submodul":[1,8,10],"subpackag":[1,5,8],"subsect":2,"subsurfac":0,"succeed":3,"support":[5,6,7],"sustain":0,"t":[4,7],"tag":[6,12],"tailor":13,"target":[3,12],"templat":[1,2],"term":3,"termin":[4,6,7],"test":[3,6],"text":4,"thick":[2,4,11,12],"three":2,"threshold":[2,4,11,12],"time":[2,4],"toler":[2,4,9],"toml":[4,7,9,12],"tool":[6,7,13],"top":[2,4,12],"tracer":[2,4,7,12],"tracerstep":[2,4,11,12],"tracertim":[2,4,11,12],"tracerwrit":[2,4,11,12],"transform":2,"tri":3,"tupl":12,"tutori":3,"two":2,"txt":[3,6],"type":[2,6,7,13],"ubuntu":[3,6],"upgrad":6,"us":2,"use":[0,2,3,4,6,7,9,13],"user":3,"v2026":6,"valid":2,"valu":2,"vector":12,"veloc":[2,4,7],"velocityconv":[2,4,11,12],"venv":6,"version":[3,4,6,10],"vertic":2,"via":[2,4,6],"virtual":6,"viscos":[2,4,11,12],"visit":3,"visual":9,"void":7,"vpymm":6,"vtk_flowstok":9,"vtk_tracertransport":9,"vtks":13,"wall":[2,12],"water":7,"welcom":[0,3],"well":[3,13],"wheel":6,"white":[2,4],"whole":[4,7],"width":[2,4,11,12],"will":3,"work":[3,6],"write":[2,4,6,12],"write_geo":[10,11,12],"x":2,"yml":[3,6]},"titles":["About pymm","pymm Python API","Configuration file","Contributing","Examples","Welcome to pymm\u2019s documentation!","Installation","Introduction","pymm","Output folder","pymm package","pymm.core package","pymm.core.pymm module","Related"],"titleterms":{"About":0,"ad":13,"api":1,"configur":2,"content":[10,11],"contribut":3,"core":[11,12],"descript":7,"devic":[2,4],"document":5,"exampl":4,"exprecc":13,"figur":2,"file":2,"folder":9,"gmsh":6,"ground":3,"imag":[2,4],"indic":5,"instal":6,"introduct":7,"issu":3,"mesh":2,"micp":13,"modul":[10,11,12],"onlin":4,"openfoam":6,"output":9,"overview":7,"packag":[6,10,11],"paramet":2,"plopm":13,"pofff":13,"problem":3,"pycopm":13,"pymm":[0,1,5,8,10,11,12],"pyopmnearwel":13,"pyopmspe11":13,"python":[1,6],"relat":[2,13],"remain":2,"report":3,"rule":3,"s":5,"seek":3,"softwar":3,"submodul":11,"subpackag":10,"support":3,"tabl":5,"welcom":5}}) \ No newline at end of file +Search.setIndex({"alltitles":{"About pymm":[[0,null]],"Configuration file":[[2,null]],"Contribute to the software":[[3,"contribute-to-the-software"]],"Contributing":[[3,null]],"Description":[[7,"description"]],"Device":[[4,"device"]],"Examples":[[4,null]],"Figure- and device-related parameters":[[2,"figure-and-device-related-parameters"]],"Gmsh":[[6,"gmsh"]],"Ground Rules":[[3,"ground-rules"]],"Image":[[4,"image"]],"Image-related parameters":[[2,"image-related-parameters"]],"Indices and tables":[[5,"indices-and-tables"]],"Installation":[[6,null]],"Introduction":[[7,null]],"Mesh-related parameters":[[2,"mesh-related-parameters"]],"Module contents":[[10,"module-pymm"],[11,"module-pymm.core"]],"Online":[[4,"online"]],"OpenFOAM":[[6,"openfoam"]],"Output folder":[[9,null]],"Overview":[[7,"overview"]],"Python package":[[6,"python-package"]],"Related":[[13,null]],"Remaining parameters":[[2,"remaining-parameters"]],"Reporting issues or problems":[[3,"reporting-issues-or-problems"]],"Seek support":[[3,"seek-support"]],"Submodules":[[11,"submodules"]],"Subpackages":[[10,"subpackages"]],"Welcome to pymm\u2019s documentation!":[[5,null]],"ad-micp":[[13,"ad-micp"]],"expreccs":[[13,"expreccs"]],"plopm":[[13,"plopm"]],"pofff":[[13,"pofff"]],"pycopm":[[13,"pycopm"]],"pymm":[[1,"pymm"],[8,null]],"pymm Python API":[[1,null]],"pymm package":[[10,null]],"pymm.core package":[[11,null]],"pymm.core.pymm module":[[12,null]],"pyopmnearwell":[[13,"pyopmnearwell"]],"pyopmspe11":[[13,"pyopmspe11"]]},"docnames":["about","api","configuration_file","contributing","examples","index","installation","introduction","modules","output_folder","pymm","pymm.core","pymm.core.pymm","related"],"envversion":{"sphinx":66,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2},"filenames":["about.rst","api.rst","configuration_file.rst","contributing.rst","examples.rst","index.rst","installation.rst","introduction.rst","modules.rst","output_folder.rst","pymm.rst","pymm.core.rst","pymm.core.pymm.rst","related.rst"],"indexentries":{},"objects":{"":[[10,0,0,"-","pymm"]],"pymm":[[11,0,0,"-","core"]],"pymm.core":[[12,0,0,"-","pymm"]],"pymm.core.pymm":[[12,1,1,"","PymmConfig"],[12,3,1,"","_assign_boundary"],[12,3,1,"","boundary_tags_left_top"],[12,3,1,"","boundary_tags_right_bottom"],[12,3,1,"","copy_and_replace"],[12,3,1,"","extract_borders"],[12,3,1,"","main"],[12,3,1,"","make_figures"],[12,3,1,"","pad_with"],[12,3,1,"","process_image"],[12,3,1,"","run_stokes"],[12,3,1,"","run_tracer"],[12,3,1,"","write_geo"]],"pymm.core.pymm.PymmConfig":[[12,2,1,"","borderTol"],[12,2,1,"","channelWidth"],[12,2,1,"","diffusion"],[12,2,1,"","grainMeaning"],[12,2,1,"","grainsSize"],[12,2,1,"","grainsTol"],[12,2,1,"","inletLocation"],[12,2,1,"","inletValue"],[12,2,1,"","iterationsMax"],[12,2,1,"","length"],[12,2,1,"","lineWidth"],[12,2,1,"","meshSize"],[12,2,1,"","pressureConv"],[12,2,1,"","rescale"],[12,2,1,"","thickness"],[12,2,1,"","threshold"],[12,2,1,"","tracerStep"],[12,2,1,"","tracerTime"],[12,2,1,"","tracerWrite"],[12,2,1,"","velocityConv"],[12,2,1,"","viscosity"],[12,2,1,"","width"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:function"},"terms":{"03e":2,"0e":[2,4],"1068x1068":4,"1c":2,"1e":[2,4],"2a":4,"2d":2,"2e":2,"3d":2,"5e":2,"600e":4,"6e":4,"74e":2,"805x252":2,"8e":[2,4],"A":13,"About":5,"An":[3,13],"As":0,"Below":13,"For":[0,2,6],"Here":4,"If":6,"In":[3,4],"NO":4,"On":2,"The":[0,1,2,3,4,6,7,9],"Then":[2,4,9],"There":2,"This":[2,7],"To":6,"We":[2,3],"While":6,"_assign_boundari":[10,11,12],"_build":3,"_iaxi":12,"accept":3,"action":3,"activ":6,"ad":[4,5],"add":[4,12],"addit":9,"al":4,"allow":2,"also":3,"altern":3,"alway":2,"anaconda":6,"analys":3,"ani":[3,12],"anoth":2,"answer":3,"api":5,"appli":7,"applic":2,"approach":[0,3],"approxim":[2,4],"approximate_polygon":2,"apt":6,"argument":7,"assign":12,"assum":4,"auto":3,"avail":[4,6],"base":[0,7,12,13],"bashrc":6,"bb":12,"bc":[2,4],"bdnb":12,"bdnl":12,"bdnr":12,"bdnt":12,"befor":3,"benali2019":2,"benchmark":13,"bin":6,"binari":[2,4],"bl":12,"black":[2,3,4],"bool":12,"border":[2,4,12],"bordertol":[2,4,11,12],"bottom":[2,4,12],"boundari":[4,7,12],"boundary_tags_left_top":[10,11,12],"boundary_tags_right_bottom":[10,11,12],"br":12,"bt":12,"build":[3,4],"built":4,"ca":4,"calcit":13,"call":9,"can":[2,3,6],"case":[2,4],"cd":6,"center":0,"central":12,"cfg":12,"chang":[3,9],"channel":[2,4],"channelwidth":[2,4,11,12],"check":[3,13],"checker":3,"checkout":6,"ci":[3,6],"class":12,"clone":6,"cluster":[2,4],"cn_border":12,"cn_grain":12,"co2":13,"code":[3,6,10],"coeffici":[2,4],"collabor":3,"color":[2,4],"com":[6,7],"command":[4,6],"commit":3,"comput":[0,2],"concentr":4,"condit":[2,4],"configur":[4,5,7,12],"consid":[2,4,7],"consist":2,"contain":[1,4],"content":[1,3,5,8],"contour":[2,4,12],"contribut":[0,5,6],"control":2,"converg":[2,4],"convert":[2,4],"coordinate_index":12,"copi":3,"copy_and_replac":[10,11,12],"core":[1,8,10],"corner":4,"correspond":[2,4],"cov":3,"creat":[2,3,6],"criteria":[2,4],"criterium":[2,4],"cross":2,"csp":13,"cssr":[6,7],"current":[2,7,9],"dark":[2,4],"de":2,"decreas":2,"default":[4,7],"defin":2,"depend":6,"depth":[2,4],"describ":[3,4,7],"descript":5,"detail":2,"dev":[3,6],"develop":6,"devic":[5,7],"dict":12,"differ":2,"diffus":[2,4,11,12],"dimens":2,"direct":9,"dmar":4,"doc":[3,12],"document":[3,7,9],"domain":7,"dst":12,"dynam":[0,2,4,13],"e":[2,4,6,7,9],"easili":7,"edg":6,"edit":12,"element":2,"em":13,"email":3,"end":[2,4],"entri":[2,4],"environ":6,"et":4,"etc":[2,6],"exampl":[2,5],"exectu":4,"execut":[1,2,3,4,6,7,9],"exprecc":5,"extend":[2,3,7],"extra":12,"extract":[2,4,12],"extract_bord":[10,11,12],"factor":[2,4],"familiar":3,"featur":0,"field":7,"fig":[2,4],"figur":[4,5,7,12],"file":[1,3,4,5,7,9,12],"first":2,"fix":3,"flag":4,"float":12,"float64":12,"flow":[4,7,12,13],"flow_trac":7,"fluid":[0,2,4],"fluid_dens":[2,4],"fluidflow":13,"foamrun":6,"fol":12,"folder":[1,3,4,5,6,7],"follow":[2,4,6,7,9],"fork":[0,3],"format":3,"found":2,"framework":[4,7,13],"full":7,"function":12,"fund":0,"g":[2,4,6,7,9],"gave":4,"general":7,"generat":[2,3,7,9,12,13],"geo":12,"geolog":13,"geometri":[2,7],"get":[3,6],"gif":13,"git":6,"github":[3,4,6,7],"gmsh":[4,5,7,12],"grain":[2,4,7,12],"grainmean":[2,4,11,12],"grainssiz":[2,4,11,12],"grainstol":[2,4,11,12],"gray":2,"greater":2,"grid":2,"ground":5,"height":[2,4],"help":[3,6],"higher":2,"histori":13,"home":4,"host":7,"howev":2,"html":[3,12],"https":[6,7,12],"ignor":3,"im":12,"imag":[0,5,7,12,13],"imh":12,"iml":12,"implement":[2,7],"import":3,"in_imag":12,"includ":[2,9],"increas":2,"index":5,"induc":13,"inject":2,"inlet":[2,4],"inletloc":[2,4,11,12],"inletvalu":[2,4,11,12],"input":[2,4,12],"insid":6,"instal":[3,5],"int":12,"interest":[4,6,13],"internal":2,"interval":[2,4],"introduct":5,"issu":[0,5],"iter":[2,4],"iterationsmax":[2,4,11,12],"joekar":4,"keep":7,"kg":[2,4],"kinemat":[2,4],"kwarg":12,"l":6,"later":12,"latest":6,"leakag":13,"left":[2,4,12],"length":[2,4,11,12],"let":2,"light":[2,4],"line":[2,3,4],"linewidth":[2,4,11,12],"link":2,"lint":6,"linux":6,"list":12,"liu2022":2,"local":3,"locat":[1,2,4],"look":[2,3],"m":[2,4,6,7],"m2":[2,4],"m3":[2,4],"main":[1,3,10,11,12],"maintain":3,"make":[3,12],"make_figur":[10,11,12],"mako":[1,2],"mamba":6,"manag":6,"mantain":3,"match":13,"mathemat":2,"maximum":[2,4],"mean":2,"measur":2,"merg":3,"mesh":[4,5,7],"mesh_flow":7,"meshsiz":[2,4,11,12],"micp":5,"microbi":13,"micromodel":[2,4],"microsystem":[2,4,7,12],"middl":[2,4],"might":[3,6,13],"miniforg":6,"minimum":[2,4],"minut":4,"miss":3,"mode":[2,7,12],"model":[2,13],"modifi":[2,6,9],"modul":[1,5,8,13],"morpholog":2,"much":2,"mypi":3,"n":3,"name":[4,7],"navier":12,"ndarray":12,"near":13,"need":3,"new":[0,2,3],"next":2,"niasar":4,"nice":[2,3],"none":12,"norc":0,"norceresearch":4,"now":4,"number":[0,2,4],"number_of_seg":12,"numer":[2,4,7,9],"numpi":12,"o":7,"object":12,"one":[2,4,9],"onli":[2,7],"onlin":[2,5],"open":13,"openfoam":[2,5,7,9,12],"openfoam14":6,"opm":13,"opt":6,"option":7,"org":12,"output":[2,5,7],"overview":5,"p":[4,7],"pa":[2,4],"packag":[0,1,5,7,8],"pad":12,"pad_width":12,"pad_with":[10,11,12],"page":[3,4,5,6],"paramet":[4,5,7,9],"paraview":9,"pat":12,"path":[4,7,12],"pattern":2,"pb":12,"perform":7,"pip":[3,6],"pixel":[2,4],"pl":12,"pleas":[0,3],"plopm":5,"png":[4,7],"pngs":[7,13],"pofff":5,"point":[2,12],"polygon":[2,4],"pore":2,"possibl":3,"pr":12,"precipit":13,"prefer":3,"present":2,"pressur":[2,4],"pressureconv":[2,4,11,12],"previous":[3,4],"problem":5,"process":12,"process_imag":[10,11,12],"produc":[2,4],"project":[0,13],"prs":3,"pt":12,"pull":[0,3],"push":3,"pushd":3,"py314":3,"pycopm":5,"pylint":3,"pymm":[2,3,4,6,7,9],"pymmconfig":[10,11,12],"pyopmnearwel":5,"pyopmspe11":5,"pytest":3,"python":[0,3,5,7,12,13],"python3":6,"quad":2,"quick":13,"r":[3,6],"rais":[0,3],"reach":[2,4],"real":2,"reduc":2,"refer":[2,12],"reference_valu":12,"region":13,"relat":[4,5,9],"releas":6,"reli":7,"remain":5,"remark":2,"remedi":13,"remove_small_object":2,"replac":[3,12],"repo":[3,6],"report":5,"repositori":[3,6],"request":[0,3],"requir":[3,6],"rescal":[2,4,11,12],"research":0,"reservoir":13,"resolut":2,"resourc":[0,2],"respect":2,"result":[2,4,9],"review":3,"right":[2,4,12],"rise":3,"ruff":3,"rule":5,"run":[2,3,4,7,9,12],"run_stok":[10,11,12],"run_trac":[10,11,12],"s":[2,4],"save":[4,9],"scalartransportfoam":2,"scale":2,"scheme":[2,4,9],"screenshot":[4,9],"script":[1,3,6,12],"search":5,"section":4,"see":[2,3,6,9,12],"seek":5,"segment":7,"select":9,"send":3,"set":[2,4],"setup":4,"setuptool":6,"shape":2,"show":[2,4,9],"side":2,"simpl":7,"simplefoam":2,"simul":[2,4,6,7,9,12,13],"sinc":4,"singl":3,"site":13,"six":3,"size":[2,4],"skimag":[2,7],"skip":6,"slip":2,"smaller":2,"softwar":5,"solut":[2,4],"solver":[2,4,7,9],"soon":3,"sourc":[4,6,13],"space":2,"spatial":7,"spe11":13,"specif":6,"squash":3,"src":[3,12],"stabl":12,"start_index":12,"static":3,"step":[2,3,4,6],"stoke":[2,4,12],"storag":13,"str":12,"studi":13,"submodul":[1,8,10],"subpackag":[1,5,8],"subsect":2,"subsurfac":0,"succeed":3,"support":[5,6,7],"sustain":0,"t":[4,7],"tag":[6,12],"tailor":13,"target":[3,12],"templat":[1,2],"term":3,"termin":[4,6,7],"test":[3,6],"text":4,"thick":[2,4,11,12],"three":2,"threshold":[2,4,11,12],"time":[2,4],"toler":[2,4,9],"toml":[4,7,9,12],"tool":[6,7,13],"top":[2,4,12],"tracer":[2,4,7,12],"tracerstep":[2,4,11,12],"tracertim":[2,4,11,12],"tracerwrit":[2,4,11,12],"transform":2,"tri":3,"tupl":12,"tutori":3,"two":2,"txt":[3,6],"type":[2,6,7,13],"ubuntu":[3,6],"upgrad":6,"us":2,"use":[0,2,3,4,6,7,9,13],"user":3,"v2026":6,"valid":2,"valu":2,"vector":12,"veloc":[2,4,7],"velocityconv":[2,4,11,12],"venv":6,"version":[3,4,6,10],"vertic":2,"via":[2,4,6],"virtual":6,"viscos":[2,4,11,12],"visit":3,"visual":9,"void":7,"vpymm":6,"vtk_flowstok":9,"vtk_tracertransport":9,"vtks":13,"wall":[2,12],"water":7,"welcom":[0,3],"well":[3,13],"wheel":6,"white":[2,4],"whole":[4,7],"width":[2,4,11,12],"will":3,"work":[3,6],"write":[2,4,6,12],"write_geo":[10,11,12],"x":2,"yml":[3,6]},"titles":["About pymm","pymm Python API","Configuration file","Contributing","Examples","Welcome to pymm\u2019s documentation!","Installation","Introduction","pymm","Output folder","pymm package","pymm.core package","pymm.core.pymm module","Related"],"titleterms":{"About":0,"ad":13,"api":1,"configur":2,"content":[10,11],"contribut":3,"core":[11,12],"descript":7,"devic":[2,4],"document":5,"exampl":4,"exprecc":13,"figur":2,"file":2,"folder":9,"gmsh":6,"ground":3,"imag":[2,4],"indic":5,"instal":6,"introduct":7,"issu":3,"mesh":2,"micp":13,"modul":[10,11,12],"onlin":4,"openfoam":6,"output":9,"overview":7,"packag":[6,10,11],"paramet":2,"plopm":13,"pofff":13,"problem":3,"pycopm":13,"pymm":[0,1,5,8,10,11,12],"pyopmnearwel":13,"pyopmspe11":13,"python":[1,6],"relat":[2,13],"remain":2,"report":3,"rule":3,"s":5,"seek":3,"softwar":3,"submodul":11,"subpackag":10,"support":3,"tabl":5,"welcom":5}}) \ No newline at end of file diff --git a/docs/text/contributing.rst b/docs/text/contributing.rst index 0bc74e7..296bc25 100644 --- a/docs/text/contributing.rst +++ b/docs/text/contributing.rst @@ -22,7 +22,7 @@ Contribute to the software #. In the main repo execute: #. **pip install -r dev-requirements.txt** (this installs the `dev-requirements.txt `_) - #. **black \-\-target-version py312 src/ tests/** (this formats the code) + #. **black \-\-target-version py314 src/ tests/** (this formats the code) #. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request) #. **ruff check src/ tests/** (this also analyses the code, and might rise issues that need to be fixed before the pull request) #. **mypy \-\-ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request) @@ -30,7 +30,7 @@ Contribute to the software #. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs `_ folder) .. tip:: - See the `CI.yml `_ script and the `Actions `_ for installation of pymm, as well as the execution of the six previous steps in Ubuntu 24.04. + See the `CI.yml `_ script and the `Actions `_ for installation of pymm, as well as the execution of the six previous steps in Ubuntu 26.04 and Python 3.14. #. Squash your commits into a single commit (see this `nice tutorial `_ if you are not familiar with this) #. Push your commit and make a pull request diff --git a/docs/text/installation.rst b/docs/text/installation.rst index b737495..b0ba1e9 100644 --- a/docs/text/installation.rst +++ b/docs/text/installation.rst @@ -45,7 +45,7 @@ install the Python requirements in a virtual environment with the following comm OpenFOAM -------- -See the `OpenFOAM page `_, where from OpenFOAM-12 the simulator is available via apt get, +See the `OpenFOAM page `_, where from OpenFOAM-12 the simulator is available via apt get, and OpenFOAM-14 is the latest release. To test if OpenFoam is installed and working, you could type in the terminal: .. code-block:: console @@ -62,4 +62,4 @@ See the `Gmsh page `_. .. tip:: See the `CI.yml `_ script - for installation of pymm, gmsh, and OpenFOAM-14 in Ubuntu using Python 3.14. + for installation of pymm, gmsh, and OpenFOAM-14 in Ubuntu 26.04 using Python 3.14. diff --git a/src/pymm/core/pymm.py b/src/pymm/core/pymm.py index 743c24b..d7d69a1 100644 --- a/src/pymm/core/pymm.py +++ b/src/pymm/core/pymm.py @@ -5,24 +5,25 @@ """Main script for pymm""" import argparse -import sys -import subprocess import shutil -from pathlib import Path -from dataclasses import dataclass -from contextlib import nullcontext +import subprocess +import sys import tomllib +from contextlib import nullcontext +from dataclasses import dataclass +from pathlib import Path from typing import Any -import numpy as np -from numpy.typing import NDArray -import skimage.transform -from skimage import io, measure -from skimage.morphology import remove_small_objects + import matplotlib as mpl import matplotlib.pyplot as plt -from matplotlib.collections import LineCollection +import numpy as np +import skimage.transform from alive_progress import alive_bar from mako.template import Template +from matplotlib.collections import LineCollection +from numpy.typing import NDArray +from skimage import io, measure +from skimage.morphology import remove_small_objects ADD_BORDER = 50 # Add arbitrary border to extract the image boundaries diff --git a/tests/test_device.py b/tests/test_device.py index 2ce8a99..ea6ec4e 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -3,8 +3,8 @@ """Test the device mode functionality""" -from pathlib import Path import subprocess +from pathlib import Path def test_device(tmp_path, monkeypatch): diff --git a/tests/test_image.py b/tests/test_image.py index 5e7406a..43b6dee 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -3,8 +3,9 @@ """Test the image mode functionality""" -from pathlib import Path import shutil +from pathlib import Path + from pymm.core.pymm import main diff --git a/tests/test_single_grain.py b/tests/test_single_grain.py index 8dd1ef4..df09667 100644 --- a/tests/test_single_grain.py +++ b/tests/test_single_grain.py @@ -3,8 +3,8 @@ """Test in a single grain""" -from pathlib import Path import subprocess +from pathlib import Path def test_single_grain(tmp_path, monkeypatch):