Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jan 19, 2024
1 parent e20e7da commit 20141b8
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 102 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install
run: |
sudo apt-get install python3-pip
pip3 install flake8 doc8
- name: Run linter
run: |
flake8 otwrapy --ignore=W503 --max-line-length 130
#doc8 doc/ --max-line-length=130
flake8 --ignore=W503 --max-line-length 130
doc8 doc/ --max-line-length=130
3 changes: 2 additions & 1 deletion doc/beam_wrapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Beam wrapper
.. automethod:: _exec
.. automethod:: _create_input_file
.. automethod:: _call()
.. automethod:: _parse_output
.. automethod:: _parse_output

158 changes: 78 additions & 80 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,45 @@
# -*- coding: utf-8 -*-

import alabaster
import sys
import os
from distutils.version import LooseVersion
import sphinx

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath("../"))

# -- General configuration ------------------------------------------------

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.intersphinx',
'sphinx.ext.autosummary',
'numpydoc',
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"numpydoc",
]

if LooseVersion(sphinx.__version__) >= '1.8':
autodoc_default_options = {'members': None, 'inherited-members': None}
else:
autodoc_default_flags = ['members', 'inherited-members']

autodoc_default_options = {"members": None, "inherited-members": None}

intersphinx_mapping = {'openturns': ('http://openturns.github.io/openturns/latest/', None)}
intersphinx_mapping = {
"openturns": ("http://openturns.github.io/openturns/latest/", None)
}
autosummary_generate = True

numpydoc_show_class_members = True
numpydoc_class_members_toctree = False


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

# The suffix(es) of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

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

# General information about the project.
project = u'otwrapy'
copyright = u'2015-2019 Phimeca'
author = u'Felipe Aguirre Martinez'
project = "otwrapy"
copyright = "2015-2024 Phimeca"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -57,135 +51,139 @@
add_module_names = False

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------

import alabaster
html_theme_path = [alabaster.get_path()]

html_theme = 'alabaster'
html_theme = "alabaster"
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html',
'donate.html',
"**": [
"about.html",
"navigation.html",
"relations.html",
"searchbox.html",
"donate.html",
]
}
html_theme_options = {
'logo': 'LogoPhiHaut.png',
'logo_name': 'otwrapy',
'description': 'Collection of tools that simplify the task of wrapping ' +
'external codes in a Python environment. ' +
'Proudly developed at ' +
'<b><a href="http://www.phimeca.com">Phimeca</a></b>',
'github_user': 'openturns',
'github_repo': 'otwrapy',
'github_banner': True,
'show_related': True,
'analytics_id': 'UA-76867657-1'
"logo": "LogoPhiHaut.png",
"logo_name": "otwrapy",
"description": "Collection of tools that simplify the task of wrapping "
+ "external codes in a Python environment. "
+ "Proudly developed at "
+ '<b><a href="http://www.phimeca.com">Phimeca</a></b>',
"github_user": "openturns",
"github_repo": "otwrapy",
"github_banner": True,
"show_related": True,
"analytics_id": "UA-76867657-1",
}

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = '_static/Icon.ico'
html_favicon = "_static/Icon.ico"

# 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"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = "%b %d, %Y"

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

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper',

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

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

# Latex figure (float) alignment
#'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
"papersize": "a4paper",
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'otwrapydoc.tex', u'otwrapy Documentation',
u'Felipe Aguirre Martinez', 'manual'),
(
master_doc,
"otwrapydoc.tex",
"otwrapy Documentation",
"Felipe Aguirre Martinez",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []
# latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True
# latex_domain_indices = True


# -- 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, 'otwrapydoc', u'otwrapy Documentation',
[author], 1)
]
# man_pages = [(master_doc, "otwrapydoc", "otwrapy Documentation", 1)]

# If true, show URL addresses after external links.
#man_show_urls = False
# man_show_urls = False


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'otwrapydoc', u'otwrapy Documentation',
author, 'otwrapy', 'One line description of project.',
'Miscellaneous'),
]
# texinfo_documents = [
# (
# master_doc,
# "otwrapydoc",
# "otwrapy Documentation",
# author,
# "otwrapy",
# "One line description of project.",
# "Miscellaneous",
# ),
# ]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# texinfo_no_detailmenu = False
3 changes: 2 additions & 1 deletion doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Examples
.. toctree::
:maxdepth: 3

beam_wrapper.rst
beam_wrapper.rst

3 changes: 2 additions & 1 deletion doc/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ In which case, `model` will be your parallelized :py:class:`openturns.Function`
machine (`n_cpus=-1`). For further information, refer to the :doc:`api`.


Or you can simply consider this as a cookbook and take what you consider useful. In which case, I suggest reading the :doc:`examples` section
Or you can simply consider this as a cookbook and take what you consider useful.
In which case, I suggest reading the :doc:`examples` section
3 changes: 0 additions & 3 deletions otwrapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

import os

__author__ = "Felipe Aguirre Martinez"
__copyright__ = "Copyright 2015-2024 Phimeca"
__version__ = "0.12.1"
__email__ = "aguirre@phimeca.fr"

base_dir = os.path.dirname(__file__)

Expand Down
3 changes: 0 additions & 3 deletions otwrapy/_otwrapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
import numpy as np
from tqdm import tqdm

__author__ = "Felipe Aguirre Martinez"
__copyright__ = "Copyright 2015-2019 Phimeca"
__email__ = "aguirre@phimeca.fr"
__all__ = ['load_array', 'dump_array', '_exec_sample_joblib',
'_exec_sample_multiprocessing', '_exec_sample_ipyparallel',
'_exec_sample_pathos', '_exec_sample_dask',
Expand Down
4 changes: 0 additions & 4 deletions otwrapy/examples/beam/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

ot.ResourceMap.SetAsUnsignedInteger('Cache-MaxSize', int(1e6))

__author__ = "Felipe Aguirre Martinez"
__copyright__ = "Copyright 2015-2019 Phimeca"
__version__ = "0.2"
__email__ = "aguirre@phimeca.fr"
__all__ = ['Wrapper']


Expand Down
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
# To use a consistent encoding
# To use a consistent encoding
from codecs import open
from os import path

Expand All @@ -26,14 +25,13 @@
version=version,
packages=find_packages(),
extras_require={
'joblib': ["joblib>=0.9.3"],
'joblib': ["joblib>=0.9.3"],
'ipyparallel': ["ipyparallel>=5.0.1"],
'pathos': ["pathos>=0.2.0"],
'dask': ["dask>=2021.01.0", "asyncssh"]
},
install_requires=["tqdm>=4.0.0"],
author="Felipe Aguirre Martinez",
author_email="aguirre@phimeca.com",
author="Phimeca",
description="General purpose OpenTURNS python wrapper tools",
long_description=long_description,
setup_requires=['pytest-runner'],
Expand Down

0 comments on commit 20141b8

Please sign in to comment.