Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (80 loc) · 4.08 KB
/
Copy pathMakefile
File metadata and controls
103 lines (80 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
PIPNAME=genice3
GITNAME=GenIce
# Use Poetry venv Python so it works on any machine (override with make PYTHON=...)
PYTHON ?= poetry run python
all: update-citations README.md docs api-notebook
echo Hello.
# Raw commit list since GenIce3 fork (see docs/development.md)
CHANGES.md: scripts/generate_changes.py
$(PYTHON) scripts/generate_changes.py > CHANGES.md
changes: CHANGES.md
# docs/references.md is generated from citations.yaml by "make docs" (replacer --docs)
README.md: temp_README.md scripts/replacer.py genice3/__init__.py genice3/plugin.py citations.yaml pyproject.toml
$(PYTHON) -m scripts.replacer < temp_README.md > README.md
# Generate docs/*.md from temp_docs/*.md (same Jinja2 context as README).
# Then embed examples/api (py/sh/yaml) into docs/api-examples/*.md.
# Depends on unitcell/molecule plugins so that ref/desc changes are reflected.
docs: temp_docs/cli.md temp_docs/getting-started.md temp_docs/changes-from-genice2.md temp_docs/output-formats.md temp_docs/unitcells.md temp_docs/water-models.md temp_docs/guest-molecules.md temp_docs/plugins.md EXTRA.yaml scripts/replacer.py genice3/__init__.py genice3/plugin.py citations.yaml pyproject.toml $(wildcard genice3/unitcell/*.py) $(wildcard genice3/molecule/*.py)
$(PYTHON) -m scripts.replacer --docs
$(PYTHON) scripts/build_api_docs.py
%: temp_% scripts/replacer.py genice3/__init__.py genice3/plugin.py citations.yaml pyproject.toml
$(PYTHON) -m scripts.replacer < $< > $@
# Regenerate API.ipynb from examples/api (READMEs + .py interleaved)
api-notebook: scripts/build_api_notebook.py $(wildcard examples/api/*/*.py) $(wildcard examples/api/*/README.md)
$(PYTHON) scripts/build_api_notebook.py
# Run all examples/api/*/*.py from project root (some may fail occasionally due to randomness)
run-api-examples: scripts/run_api_examples.py
$(PYTHON) scripts/run_api_examples.py --all
# Run the cylindrical prism-ice API example and write GRO output.
cylindrical-ice-example: examples/api/exotic_ice/17_cylindrical_ice.py
$(PYTHON) examples/api/exotic_ice/17_cylindrical_ice.py > examples/api/exotic_ice/17_cylindrical_ice.gro
@echo "Wrote examples/api/exotic_ice/17_cylindrical_ice.gro"
update-citations:
cp citations.yaml old.citations.yaml
$(PYTHON) scripts/citation.py < old.citations.yaml > citations.yaml
-diff old.citations.yaml citations.yaml
unitcell-test: $(patsubst genice3/unitcell/%.py, %.unitcell-test, $(wildcard genice3/unitcell/[0-9A-Za-z]*.py))
%.unitcell-test:
$(PYTHON) -m tests.unitcell_legacy.lattice_vs_unitcell $*
touch $@
# prepare step is not needed for genice3 (no symlink conversion)
prepare:
@echo "No preparation needed for genice3"
# docs/ や mkdocs.yml の変更で自動リビルド・ブラウザリロード(watchdog 入りで監視が安定)
serve:
mkdocs serve
# mkdocs serve 起動中に、キー一発でブラウザをリロードしたいとき用。
# docs/ 内を touch すると livereload が検知してブラウザが更新される。
# 自動監視が効かない環境(Dropbox等)では、編集後に make docs && make reload または
# Cursor のキーバインドで「make reload」を実行するとよい。
reload:
@touch docs/index.md && echo "Touched docs/index.md — livereload should refresh the browser."
test:
make -C tests all
# Test PyPI へアップロード(事前に poetry config repositories.testpypi https://test.pypi.org/legacy/ を実行)
test-deploy: clean prepare build
poetry publish -r testpypi
test-install:
pip3 install --index-url https://test.pypi.org/simple/ $(PIPNAME)
uninstall:
-pip3 uninstall -y $(PIPNAME)
build: README.md $(wildcard genice3/*.py)
poetry build
deploy: clean prepare build
poetry publish
check:
poetry build
clone-myself-from-github:
git clone -b genice-core https://github.com/vitroid/GenIce.git ../GenIce3.clone
%.png: %.pov
povray +I$< +W1000 +H1000 +D +FN +O$@
clean:
-rm -rf build dist
distclean:
-rm *.scad *.yap *.unitcell-test *.gro *.cif @*
-rm -rf build dist
-rm -rf *.egg-info
-rm .DS_Store
find . -name __pycache__ | xargs rm -rf
find . -name \*.pyc | xargs rm -rf
find . -name \*~ | xargs rm -rf