Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ target/

#Ipython Notebook
.ipynb_checkpoints

#revieweing and package modernization
venv_ezyrb/
22 changes: 14 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,22 @@
import sphinx
from sphinx.errors import VersionRequirementError
import sphinx_rtd_theme
import time
import importlib.metadata


# 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('../..'))
import ezyrb.meta as meta


# -- Project infirmation --------
_DISTRIBUTION_METADATA = importlib.metadata.metadata("ezyrb")
project = _DISTRIBUTION_METADATA["Name"]
copyright = f'2016-{time.strftime("%Y")}, EZyRB contributors'
author = _DISTRIBUTION_METADATA["Author"]


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

Expand Down Expand Up @@ -69,10 +79,6 @@
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = meta.__project__
copyright = meta.__copyright__
author = meta.__author__

# autoclass
autoclass_content = 'both'
Expand All @@ -82,9 +88,9 @@
# built documents.
#
# The short X.Y version.
version = meta.__version__
# The full version, including alpha/beta/rc tags.
version = _DISTRIBUTION_METADATA["Version"]
release = version
# The full version, including alpha/beta/rc tags.

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -287,7 +293,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, meta.__title__, u'EZyRB Documentation',
(master_doc, 'ezyrb' , u'EZyRB Documentation',
[author], 1)
]

Expand Down
1 change: 0 additions & 1 deletion ezyrb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
'ReducedOrderModel', 'PODAE', 'RegularGrid'
]

from .meta import *
from .database import Database
from .snapshot import Snapshot
from .parameter import Parameter
Expand Down
16 changes: 0 additions & 16 deletions ezyrb/meta.py

This file was deleted.

59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[project]
name = "ezyrb"
version = "1.3.1"
description = "Easy Reduced Basis"
readme = "README.md"
authors = [
{name = "Nicola Demo", email = "demo.nicola@gmail.com"},
{name = "Marco Tezzele", email = "marcotez@gmail.com"},
]
license = { text = "MIT" }
keywords = [
"pod", "interpolation", "reduced-basis",
"model-order-reduction", "scientific-computing"
]
dependencies = [
"future",
"numpy",
"scipy",
"matplotlib",
"scikit-learn>=1.0",
"torch",
"datasets"
]
requires-python = ">=3.8"

[project.optional-dependencies]
docs = [
"sphinx",
"sphinx_rtd_theme"
]
test = [
"pytest",
"pytest-cov"
]
dev = [
"black",
"pylint"
]
tutorial = [
"jupyter",
"notebook"
]

[project.urls]
Homepage = "https://github.com/mathLab/EZyRB"
Repository = "https://github.com/mathLab/EZyRB"

[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["ezyrb*"]

[tool.black]
line-length = 80

[tool.isort]
profile = "black"
61 changes: 0 additions & 61 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tutorials/tutorial-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def hf_to_numpy(ds):
ax[i].triplot(triang, 'b-', lw=0.1)
cm = ax[i].tripcolor(triang, snapshots[i])
fig.colorbar(cm, ax=ax[i])
ax[i].set_title('($\mu_0={:5.2f}, \mu_1={:5.2f})$'.format(*param[i]))
ax[i].set_title(r'($\mu_0={:5.2f}, \mu_1={:5.2f})$'.format(*param[i]))


# First of all, we create a `Database` object from the parameters and the snapshots.
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-3.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def wave(t, res=256):
plt.figure(figsize=(6,4))
plt.plot(N_modes[:10], s[:10]/np.max(s),"-s",color = "blue", label='POD')
plt.plot(N_modes_shifted, s_shifted/np.max(s_shifted),"-o", color = "red", label='NNsPOD')
plt.ylabel('$\sigma/\sigma_{1}$', size=15)
plt.ylabel(r'$\sigma/\sigma_{1}$', size=15)
plt.xlabel('Modes', size=15)
plt.xlim(0, 11)
plt.legend(fontsize=12)
Expand Down
16 changes: 8 additions & 8 deletions utils/mathlab_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


module = 'ezyrb'
meta_file = os.path.join(module, 'meta.py')
version_line = r'__version__.*=.*"(.+?)"'
pyproject_file = 'pyproject.toml'
version_line = r'version.*=.*"(.+?)"'


class Version:
Expand Down Expand Up @@ -34,11 +34,11 @@ def __str__(self):


def get_version():
with open(meta_file, 'r') as fp:
with open(pyproject_file, 'r') as fp:
content = fp.read()

try:
found = re.search(r'__version__.*=.*"(.+?)"', content).group(1)
found = re.search(r'version.*=.*"(.+?)"', content).group(1)
except AttributeError:
pass

Expand All @@ -48,13 +48,13 @@ def get_version():


def set_version(version):
with open(meta_file, 'r') as fp:
with open(pyproject_file, 'r') as fp:
content = fp.read()

line_string = '__version__ = "{}"'.format(version)
text_after = re.sub('__version__.*=.*"(.+?)"', line_string, content)
line_string = 'version = "{}"'.format(version)
text_after = re.sub('version.*=.*"(.+?)"', line_string, content)

with open(meta_file, 'w') as fp:
with open(pyproject_file, 'w') as fp:
fp.write(text_after)


Expand Down
Loading