From 05873c0e224351b8a25af6eb4910fa691b54017f Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Wed, 6 Apr 2022 23:03:54 +0200 Subject: [PATCH] Add pyproject.toml --- multigrid/.gitignore | 4 ++++ multigrid/{eulerplot => plotter/plotter.py} | 6 +++++- multigrid/pyproject.toml | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 multigrid/.gitignore rename multigrid/{eulerplot => plotter/plotter.py} (99%) create mode 100644 multigrid/pyproject.toml diff --git a/multigrid/.gitignore b/multigrid/.gitignore new file mode 100644 index 0000000..d4b79be --- /dev/null +++ b/multigrid/.gitignore @@ -0,0 +1,4 @@ +build +dist +*.egg-info +.venv diff --git a/multigrid/eulerplot b/multigrid/plotter/plotter.py similarity index 99% rename from multigrid/eulerplot rename to multigrid/plotter/plotter.py index 3b2de54..b3862ff 100755 --- a/multigrid/eulerplot +++ b/multigrid/plotter/plotter.py @@ -267,7 +267,7 @@ def read_from_file(filename): return grids, file["t"] -if __name__ == "__main__": +def main(): parser = ArgumentParser(description="Plot a solution from the eulersolver") parser.add_argument("filename", metavar="filename", type=str) parser.add_argument("-s", help="Save figure", action="store_true", dest="save") @@ -295,3 +295,7 @@ if __name__ == "__main__": plot_pressure_slider(grids, t) else: plot_pressure(grids, args.save, args.output) + + +if __name__ == "__main__": + main() diff --git a/multigrid/pyproject.toml b/multigrid/pyproject.toml new file mode 100644 index 0000000..e7e128f --- /dev/null +++ b/multigrid/pyproject.toml @@ -0,0 +1,18 @@ +[project] +name = "plotter" +version = "0.0.1" +dependencies = [ + "matplotlib", + "numpy", + "h5py", +] + +[project.scripts] +eulerplot = "plotter.plotter:main" + +[tool.setuptools] +packages = ["plotter"] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta"