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

Tweaks to messages and re-run notebooks #83

Merged
merged 5 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Congratulations!
You landed at an altitude of 1309m.
https://opentopomap.org/#marker=15/57.07019/-3.669487
You are 31m from the nearest named hill top, "Ben Macdui",
ranked the 2d heighest in GB.
ranked the 2nd highest in GB.
http://hillsummits.org.uk/htm_summit/518.htm
```

Expand Down
75 changes: 38 additions & 37 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,35 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]

# Autodoc defaults
autodoc_default_options = {
'members': None,
'inherited-members': None,
"members": None,
"inherited-members": None,
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'nevis'
copyright = u'2022, University of Nottingham'
author = u'"Where is Ben Nevis" authors'
project = "nevis"
copyright = "2022, University of Nottingham"
author = '"Where is Ben Nevis" authors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -72,7 +72,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -81,11 +81,11 @@

# Suppress warnings about unused footnotes (i.e. citations of papers)
suppress_warnings = [
'ref.footnote',
"ref.footnote",
]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -96,33 +96,30 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {

# See: https://alabaster.readthedocs.io/en/latest/customization.html

# Fixed sidebar is unusable: Doesn't have its own scrollbar!
# 'fixed_sidebar': True,

'page_width': '1280px',
'sidebar_width': '320px',
"page_width": "1280px",
"sidebar_width": "320px",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Nevisdoc'
htmlhelp_basename = "Nevisdoc"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -131,15 +128,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -149,19 +143,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Nevis.tex', u'nevis Documentation',
u'"Where is Ben Nevis" Authors', 'manual'),
(
master_doc,
"Nevis.tex",
"nevis Documentation",
'"Where is Ben Nevis" Authors',
"manual",
),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'nevis', u'nevis Documentation',
[author], 1)
]
man_pages = [(master_doc, "nevis", "nevis Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -170,8 +166,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'nevis', u'nevis Documentation',
author, 'nevis', 'API docs for nevis.',
'Miscellaneous'),
(
master_doc,
"nevis",
"nevis Documentation",
author,
"nevis",
"API docs for nevis.",
"Miscellaneous",
),
]

3 changes: 1 addition & 2 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
nevis.download_os_terrain_50()

# Create and store a figure
nevis.write_test_figure('gb-small.png')

nevis.write_test_figure("gb-small.png")
60 changes: 27 additions & 33 deletions examples/fitting-with-nlopt.ipynb

Large diffs are not rendered by default.

86 changes: 39 additions & 47 deletions examples/fitting-with-pints.ipynb

Large diffs are not rendered by default.

42 changes: 18 additions & 24 deletions examples/fitting-with-scipy.ipynb

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions gb.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@
points = trajectory = None
if False:
import numpy as np

ben = nevis.ben()
points = []
trajectory = [np.array(ben.grid)]
for i in range(50):
trajectory.append(
trajectory[-1] + (np.random.random(2) - 0.5) * 5e2 * i**1.5)
trajectory[-1] + (np.random.random(2) - 0.5) * 5e2 * i**1.5
)
for j in range(10):
points.append(
trajectory[-1] + (np.random.random(2) - 0.5) * 8e2 * i**1.5)
trajectory[-1] + (np.random.random(2) - 0.5) * 8e2 * i**1.5
)
trajectory = np.array(trajectory)
points = np.array(points)

Expand All @@ -59,8 +62,8 @@

# Labels
labels = {
'Ben Nevis': nevis.ben(),
'Holme Fen': nevis.fen(),
"Ben Nevis": nevis.ben(),
"Holme Fen": nevis.fen(),
}

# Load data
Expand All @@ -81,7 +84,6 @@
)

# Save plot, and check resulting image dimensions
if not os.path.isdir('results'):
os.makedirs('results')
nevis.save_plot('results/gb.png', fig, heights, verbose=True)

if not os.path.isdir("results"):
os.makedirs("results")
nevis.save_plot("results/gb.png", fig, heights, verbose=True)
Loading
Loading