From 75a1c1c460d2d3dbb93ebe09df58d22e14fa73ec Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 16:25:33 +0200 Subject: [PATCH 1/7] Fail Sphinx on warnings, even --- .github/workflows/sphinx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 49621349..9f046d66 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -14,7 +14,7 @@ env: DEFAULT_BRANCH: "master" # If these SPHINXOPTS are enabled, then be strict about the # builds and fail on any warnings. - #SPHINXOPTS: "-W --keep-going -T" + SPHINXOPTS: "-W --keep-going -T" GENERATE_PDF: false # to enable, must be 'true' lowercase GENERATE_SINGLEHTML: false # to enable, must be 'true' lowercase PDF_FILENAME: lesson.pdf From 1b3b2db6110cb630df8b6d457b3963c1f3f229b9 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 16:29:28 +0200 Subject: [PATCH 2/7] Fix indentation errors? --- scripts/magnetopause2d.py | 3 +-- scripts/magnetopause3d.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/magnetopause2d.py b/scripts/magnetopause2d.py index 910cda71..285e7c41 100644 --- a/scripts/magnetopause2d.py +++ b/scripts/magnetopause2d.py @@ -7,8 +7,7 @@ ''' -Finds the magnetopause position by tracing steamines of the plasma flow for two-dimensional Vlasiator runs -Needs the yt package +Finds the magnetopause position by tracing steamines of the plasma flow for two-dimensional Vlasiator runs. Needs the yt package. ''' def interpolate(streamline, x_points): diff --git a/scripts/magnetopause3d.py b/scripts/magnetopause3d.py index 550c4461..419c3ddc 100644 --- a/scripts/magnetopause3d.py +++ b/scripts/magnetopause3d.py @@ -9,8 +9,7 @@ from yt.visualization.api import Streamlines ''' -Finds the magnetopause position by tracing steamines of the plasma flow for three-dimensional Vlasiator runs -Needs the yt package +Finds the magnetopause position by tracing steamines of the plasma flow for three-dimensional Vlasiator runs. Needs the yt package. ''' From 59ded70cf8925d0a60735aaa941e42b7fd38ba19 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 16:30:26 +0200 Subject: [PATCH 3/7] Fix indentation errors? --- scripts/magnetopause3d.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/magnetopause3d.py b/scripts/magnetopause3d.py index 419c3ddc..c9a968ec 100644 --- a/scripts/magnetopause3d.py +++ b/scripts/magnetopause3d.py @@ -63,21 +63,21 @@ def make_surface(coords): How it works: Three points make a triangle, triangles make the surface. For every two planes next to each other: - take every other point from plane1, every other from plane2 (in order!) - from list of points: every three points closest to each other make a surface - - Example: - plane 1: [v1, v2, v3, v4] - plane 2: [v5, v6, v7, v8] - - -> list: [v1, v5, v2, v6, v3,...] - -> triangles: - v1 v5 v2 - v5 v2 v6 - v2 v6 v3 - . - . - . + - take every other point from plane1, every other from plane2 (in order!) + - from list of points: every three points closest to each other make a surface + + Example: + plane 1: [v1, v2, v3, v4] + plane 2: [v5, v6, v7, v8] + + -> list: [v1, v5, v2, v6, v3,...] + -> triangles: + v1 v5 v2 + v5 v2 v6 + v2 v6 v3 + . + . + . ''' verts = [] #points From 864f640cb79b5ae91653ec0de1fc6f7b23dd98d4 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 16:33:35 +0200 Subject: [PATCH 4/7] Fix indentation errors? --- pyVlsv/vlsvreader.py | 2 +- scripts/magnetopause3d.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyVlsv/vlsvreader.py b/pyVlsv/vlsvreader.py index 2918e1e8..df0157d0 100644 --- a/pyVlsv/vlsvreader.py +++ b/pyVlsv/vlsvreader.py @@ -2127,7 +2127,7 @@ def fsgrid_array_to_vg(self, array): of this reader. :param array: array with first three dimensions corresponding to the - dimensions of the fsgrid associated with this reader. + dimensions of the fsgrid associated with this reader. :returns: Vlasov grid data (in file order) of array averaged to Vlasov Grid. ''' cellIds=self.read_variable("CellID") diff --git a/scripts/magnetopause3d.py b/scripts/magnetopause3d.py index c9a968ec..cbf4a500 100644 --- a/scripts/magnetopause3d.py +++ b/scripts/magnetopause3d.py @@ -72,12 +72,12 @@ def make_surface(coords): -> list: [v1, v5, v2, v6, v3,...] -> triangles: - v1 v5 v2 - v5 v2 v6 - v2 v6 v3 - . - . - . + v1 v5 v2 + v5 v2 v6 + v2 v6 v3 + . + . + . ''' verts = [] #points From 2d137d8548584ee2fbf784c2956c8abdfab2daa3 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 16:41:19 +0200 Subject: [PATCH 5/7] add _static folder creation --- Documentation/sphinx/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/sphinx/conf.py b/Documentation/sphinx/conf.py index bee65bc7..0a90a3c4 100644 --- a/Documentation/sphinx/conf.py +++ b/Documentation/sphinx/conf.py @@ -6,7 +6,7 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -import sys +import sys, os from pathlib import Path sys.path.insert(0, str(Path('..', '..').resolve())) @@ -35,3 +35,6 @@ html_theme = 'sphinx_rtd_theme' html_logo = "logo_color.png" html_static_path = ['_static'] + +os.mkdir('_static') + From 16e9cfbc88d527773f69f1bf862176dd751c3e27 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 17:00:23 +0200 Subject: [PATCH 6/7] Create dummy folders to suppress warnings (if _static and _templates do not exist yet) --- Documentation/sphinx/conf.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/sphinx/conf.py b/Documentation/sphinx/conf.py index 0a90a3c4..6a496bc6 100644 --- a/Documentation/sphinx/conf.py +++ b/Documentation/sphinx/conf.py @@ -25,6 +25,13 @@ ] templates_path = ['_templates'] +# Create a dummy _templates folder if it does not exist +try: + os.mkdir("_templates") +except: + pass + + exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] @@ -36,5 +43,8 @@ html_logo = "logo_color.png" html_static_path = ['_static'] -os.mkdir('_static') - +# Create a dummy _static folder if it does not exist +try: + os.mkdir("_static") +except: + pass From 095d747be3d69eb35063bba58e8c10c05e226a08 Mon Sep 17 00:00:00 2001 From: Alho Markku J Date: Fri, 29 Nov 2024 17:03:52 +0200 Subject: [PATCH 7/7] Moving script file docstrings about --- scripts/magnetopause2d.py | 8 +++++--- scripts/magnetopause3d.py | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/magnetopause2d.py b/scripts/magnetopause2d.py index 285e7c41..62174652 100644 --- a/scripts/magnetopause2d.py +++ b/scripts/magnetopause2d.py @@ -1,3 +1,7 @@ +''' +Finds the magnetopause position by tracing steamines of the plasma flow for two-dimensional Vlasiator runs. Needs the yt package. +''' + import matplotlib.pylab as plt import numpy as np import pytools as pt @@ -6,9 +10,7 @@ from yt.visualization.api import Streamlines -''' -Finds the magnetopause position by tracing steamines of the plasma flow for two-dimensional Vlasiator runs. Needs the yt package. -''' + def interpolate(streamline, x_points): diff --git a/scripts/magnetopause3d.py b/scripts/magnetopause3d.py index cbf4a500..a6aa0a9f 100644 --- a/scripts/magnetopause3d.py +++ b/scripts/magnetopause3d.py @@ -1,3 +1,6 @@ +''' +Finds the magnetopause position by tracing steamines of the plasma flow for three-dimensional Vlasiator runs. Needs the yt package. +''' from pyCalculations import ids3d import matplotlib.pylab as plt import numpy as np @@ -8,9 +11,7 @@ from mpl_toolkits import mplot3d from yt.visualization.api import Streamlines -''' -Finds the magnetopause position by tracing steamines of the plasma flow for three-dimensional Vlasiator runs. Needs the yt package. -''' + def to_Re(m): #meters to Re