graphmdo 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graphmdo-0.1.2/.github/workflows/docs.yml +44 -0
- graphmdo-0.1.2/.github/workflows/pypi-publish.yml +44 -0
- graphmdo-0.1.2/.github/workflows/quality.yml +29 -0
- graphmdo-0.1.2/.github/workflows/security.yml +29 -0
- graphmdo-0.1.2/.gitignore +212 -0
- graphmdo-0.1.2/.pre-commit-config.yaml +16 -0
- graphmdo-0.1.2/.python-version +1 -0
- graphmdo-0.1.2/AGENTS.md +38 -0
- graphmdo-0.1.2/Dockerfile +35 -0
- graphmdo-0.1.2/LICENSE +21 -0
- graphmdo-0.1.2/PKG-INFO +142 -0
- graphmdo-0.1.2/README.md +121 -0
- graphmdo-0.1.2/docker-compose.yml +41 -0
- graphmdo-0.1.2/docs/api/core/components.md +3 -0
- graphmdo-0.1.2/docs/api/core/surrogates.md +3 -0
- graphmdo-0.1.2/docs/api/core/translator.md +3 -0
- graphmdo-0.1.2/docs/api/db/client.md +3 -0
- graphmdo-0.1.2/docs/api/db/graph_manager.md +3 -0
- graphmdo-0.1.2/docs/api/optimization/optimizer.md +15 -0
- graphmdo-0.1.2/docs/dev-guide/contributing.md +46 -0
- graphmdo-0.1.2/docs/index.md +20 -0
- graphmdo-0.1.2/docs/technical-reference/architecture.md +45 -0
- graphmdo-0.1.2/docs/technical-reference/microservices.md +24 -0
- graphmdo-0.1.2/docs/user-guide/installation.md +47 -0
- graphmdo-0.1.2/docs/user-guide/quick-start.md +88 -0
- graphmdo-0.1.2/docs/user-guide/running-optimization.md +58 -0
- graphmdo-0.1.2/main.py +93 -0
- graphmdo-0.1.2/mkdocs.yml +46 -0
- graphmdo-0.1.2/pyproject.toml +45 -0
- graphmdo-0.1.2/src/mdo_framework/__init__.py +0 -0
- graphmdo-0.1.2/src/mdo_framework/core/__init__.py +0 -0
- graphmdo-0.1.2/src/mdo_framework/core/components.py +85 -0
- graphmdo-0.1.2/src/mdo_framework/core/surrogates.py +66 -0
- graphmdo-0.1.2/src/mdo_framework/core/topology.py +102 -0
- graphmdo-0.1.2/src/mdo_framework/core/translator.py +81 -0
- graphmdo-0.1.2/src/mdo_framework/db/__init__.py +0 -0
- graphmdo-0.1.2/src/mdo_framework/db/client.py +41 -0
- graphmdo-0.1.2/src/mdo_framework/db/graph_manager.py +220 -0
- graphmdo-0.1.2/src/mdo_framework/optimization/__init__.py +0 -0
- graphmdo-0.1.2/src/mdo_framework/optimization/optimizer.py +278 -0
- graphmdo-0.1.2/src/services/__init__.py +0 -0
- graphmdo-0.1.2/src/services/execution/__init__.py +0 -0
- graphmdo-0.1.2/src/services/execution/main.py +408 -0
- graphmdo-0.1.2/src/services/graph/__init__.py +0 -0
- graphmdo-0.1.2/src/services/graph/main.py +107 -0
- graphmdo-0.1.2/src/services/optimization/__init__.py +0 -0
- graphmdo-0.1.2/src/services/optimization/main.py +122 -0
- graphmdo-0.1.2/tests/conftest.py +47 -0
- graphmdo-0.1.2/tests/test_components.py +162 -0
- graphmdo-0.1.2/tests/test_db_client.py +54 -0
- graphmdo-0.1.2/tests/test_graph_manager.py +199 -0
- graphmdo-0.1.2/tests/test_integration.py +64 -0
- graphmdo-0.1.2/tests/test_main.py +47 -0
- graphmdo-0.1.2/tests/test_optimizer.py +162 -0
- graphmdo-0.1.2/tests/test_services.py +736 -0
- graphmdo-0.1.2/tests/test_services_opt.py +18 -0
- graphmdo-0.1.2/tests/test_surrogates.py +72 -0
- graphmdo-0.1.2/tests/test_topology.py +69 -0
- graphmdo-0.1.2/tests/test_translator.py +78 -0
- graphmdo-0.1.2/uv.lock +2864 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
deploy:
|
|
15
|
+
environment:
|
|
16
|
+
name: github-pages
|
|
17
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v3
|
|
22
|
+
|
|
23
|
+
- name: Install uv
|
|
24
|
+
uses: astral-sh/setup-uv@v5
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: uv sync --frozen --all-extras --dev
|
|
33
|
+
|
|
34
|
+
- name: Build Documentation
|
|
35
|
+
run: uv run mkdocs build
|
|
36
|
+
|
|
37
|
+
- name: Upload artifact
|
|
38
|
+
uses: actions/upload-pages-artifact@v3
|
|
39
|
+
with:
|
|
40
|
+
path: ./site
|
|
41
|
+
|
|
42
|
+
- name: Deploy to GitHub Pages
|
|
43
|
+
id: deployment
|
|
44
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pypi-publish:
|
|
9
|
+
name: Build and publish Python distribution 📦 to PyPI
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: pypi
|
|
13
|
+
url: https://pypi.org/p/graphmdo
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v5
|
|
26
|
+
with:
|
|
27
|
+
version: "latest"
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.12"
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: uv sync --frozen
|
|
37
|
+
- name: Build distribution 📦
|
|
38
|
+
run: uv build
|
|
39
|
+
|
|
40
|
+
- name: Publish distribution 📦 to PyPI
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
42
|
+
with:
|
|
43
|
+
# This action requires the OIDC id-token permission setup above
|
|
44
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Quality Checks
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
quality:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
|
+
- name: Install uv
|
|
11
|
+
uses: astral-sh/setup-uv@v5
|
|
12
|
+
- name: Set up Python
|
|
13
|
+
uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
- name: Install dependencies
|
|
17
|
+
run: uv sync --frozen --all-extras --dev
|
|
18
|
+
- name: Run Ruff
|
|
19
|
+
run: uv run ruff check .
|
|
20
|
+
- name: Run Tests
|
|
21
|
+
env:
|
|
22
|
+
PYTHONPATH: .
|
|
23
|
+
run: uv run pytest --cov=src/mdo_framework --cov=src/services --cov-report=xml tests/
|
|
24
|
+
- name: Upload coverage to Codecov
|
|
25
|
+
uses: codecov/codecov-action@v5
|
|
26
|
+
with:
|
|
27
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
28
|
+
files: ./coverage.xml
|
|
29
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Security Scan
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
name: Build
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout code
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
|
+
|
|
17
|
+
- name: Build an image from Dockerfile
|
|
18
|
+
run: |
|
|
19
|
+
docker build -t docker.io/my-organization/my-app:${{ github.sha }} .
|
|
20
|
+
|
|
21
|
+
- name: Run Trivy vulnerability scanner
|
|
22
|
+
uses: aquasecurity/trivy-action@master
|
|
23
|
+
with:
|
|
24
|
+
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
|
|
25
|
+
format: 'table'
|
|
26
|
+
exit-code: '1'
|
|
27
|
+
ignore-unfixed: true
|
|
28
|
+
vuln-type: 'os,library'
|
|
29
|
+
severity: 'CRITICAL,HIGH'
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
208
|
+
|
|
209
|
+
# OpenMDAO Test Artifacts
|
|
210
|
+
pytest*_out/
|
|
211
|
+
*.openmdao_out
|
|
212
|
+
reports/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.15.4
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [ --fix ]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
- repo: local
|
|
9
|
+
hooks:
|
|
10
|
+
- id: pytest
|
|
11
|
+
name: pytest
|
|
12
|
+
entry: uv run pytest
|
|
13
|
+
language: system
|
|
14
|
+
types: [python]
|
|
15
|
+
pass_filenames: false
|
|
16
|
+
always_run: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
graphmdo-0.1.2/AGENTS.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Strict Coding Standards
|
|
4
|
+
|
|
5
|
+
1. **PEP 20 (The Zen of Python)**
|
|
6
|
+
- Explicit is better than implicit.
|
|
7
|
+
- Simple is better than complex.
|
|
8
|
+
- Readability counts.
|
|
9
|
+
|
|
10
|
+
2. **PEP 8 (Style Guide for Python Code)**
|
|
11
|
+
- Indentation: 4 spaces.
|
|
12
|
+
- Line Length: 88 characters.
|
|
13
|
+
- Naming Conventions:
|
|
14
|
+
- Functions/Variables: `lowercase_with_underscores`
|
|
15
|
+
- Classes: `CapitalizedWords`
|
|
16
|
+
- Constants: `ALL_CAPS_WITH_UNDERSCORES`
|
|
17
|
+
- Imports: Standard library, third-party, local application.
|
|
18
|
+
- Type Hinting: Use explicit Python 3 type hints.
|
|
19
|
+
|
|
20
|
+
## Project Architecture
|
|
21
|
+
|
|
22
|
+
- **Phase 1**: Graph Database (FalkorDB).
|
|
23
|
+
- **Phase 2**: Graph Formulation (KADMOS/OpenCypher).
|
|
24
|
+
- **Phase 3**: Execution (OpenMDAO, SMT).
|
|
25
|
+
- **Phase 5**: Constrained Optimization (BoTorch).
|
|
26
|
+
|
|
27
|
+
## Implementation Directives
|
|
28
|
+
|
|
29
|
+
- **Native Graph Construction**: Use FalkorDB property graph.
|
|
30
|
+
- **MDO Component Wrapping**: Ensure `setup()` and `setup_partials()` are clearly defined.
|
|
31
|
+
- **Optimization Constraints**: Use epsilon-constraint methods.
|
|
32
|
+
|
|
33
|
+
## Dependency Management
|
|
34
|
+
|
|
35
|
+
- This project uses `uv` for dependency management.
|
|
36
|
+
- To add a dependency: `uv add <package_name>`
|
|
37
|
+
- To run commands in the environment: `uv run <command>`
|
|
38
|
+
- **Do not use pip install manually.**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
# Grab uv directly from astral's image (faster and smaller than pip install)
|
|
4
|
+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
5
|
+
|
|
6
|
+
# Docker-specific uv optimizations
|
|
7
|
+
ENV UV_COMPILE_BYTECODE=1
|
|
8
|
+
ENV UV_LINK_MODE=copy
|
|
9
|
+
|
|
10
|
+
# Pass a dummy version to setuptools-scm during the docker build to prevent failures
|
|
11
|
+
ENV SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0"
|
|
12
|
+
|
|
13
|
+
# Security: Create and use a non-root user
|
|
14
|
+
RUN useradd -m appuser
|
|
15
|
+
|
|
16
|
+
WORKDIR /app
|
|
17
|
+
RUN chown appuser:appuser /app
|
|
18
|
+
|
|
19
|
+
USER appuser
|
|
20
|
+
|
|
21
|
+
# Copy dependency files FIRST
|
|
22
|
+
COPY --chown=appuser:appuser pyproject.toml uv.lock README.md ./
|
|
23
|
+
|
|
24
|
+
# Step 1: Install dependencies ONLY.
|
|
25
|
+
# Docker will CACHE this heavy step unless pyproject.toml or uv.lock changes.
|
|
26
|
+
RUN uv sync --frozen --no-install-project
|
|
27
|
+
|
|
28
|
+
# Step 2: Copy your source code (changes often)
|
|
29
|
+
COPY --chown=appuser:appuser src/ src/
|
|
30
|
+
|
|
31
|
+
# Step 3: Install the project itself (fast)
|
|
32
|
+
RUN uv sync --frozen
|
|
33
|
+
|
|
34
|
+
# Default command (path adjusted to installed package location or src if editable)
|
|
35
|
+
CMD ["uv", "run", "uvicorn", "services.graph.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
graphmdo-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Julien T.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
graphmdo-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: graphmdo
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A dynamic, graph-driven Multidisciplinary Design Optimization (MDO) framework integrating FalkorDB, OpenMDAO, and multi-fidelity surrogate models.
|
|
5
|
+
Author-email: jultou-raa <64092886+jultou-raa@users.noreply.github.com>, google-labs-jules-bot <161369871+google-labs-jules-bot@users.noreply.github.com>
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.12
|
|
8
|
+
Requires-Dist: ax-platform>=1.2.3
|
|
9
|
+
Requires-Dist: botorch>=0.17.0
|
|
10
|
+
Requires-Dist: falkordb>=1.6.0
|
|
11
|
+
Requires-Dist: fastapi>=0.133.1
|
|
12
|
+
Requires-Dist: httpx>=0.28.1
|
|
13
|
+
Requires-Dist: networkx>=3.6.1
|
|
14
|
+
Requires-Dist: numpy>=2.4.2
|
|
15
|
+
Requires-Dist: openmdao>=3.42.0
|
|
16
|
+
Requires-Dist: pymoo>=0.6.1.6
|
|
17
|
+
Requires-Dist: scipy>=1.17.1
|
|
18
|
+
Requires-Dist: smt>=2.11.1
|
|
19
|
+
Requires-Dist: uvicorn>=0.41.0
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# GraphMDO: Dynamic Multi-Fidelity MDO Framework
|
|
23
|
+
|
|
24
|
+
[](https://www.python.org/)
|
|
25
|
+
[](https://github.com/jultou-raa/GraphMDO/actions/workflows/quality.yml)
|
|
26
|
+
[](https://github.com/jultou-raa/GraphMDO/actions/workflows/security.yml)
|
|
27
|
+
[](https://github.com/jultou-raa/GraphMDO/actions/workflows/docs.yml)
|
|
28
|
+
[](https://codecov.io/gh/jultou-raa/GraphMDO)
|
|
29
|
+
|
|
30
|
+
GraphMDO bridges data engineering and MDO. It extracts topological data (solvers, variables, fidelity levels) to form an oriented graph, specifically utilizing KADMOS for semantic formulation and exporting to CMDOWS. The execution is handled by OpenMDAO and the Surrogate Modeling Toolbox (SMT), driven by constrained Bayesian optimization (ax-platform) or evolutionary algorithms (pymoo). The primary operational goal is to isolate and maximize a single target performance metric while strictly holding all other performance metrics constant.
|
|
31
|
+
|
|
32
|
+
## Key Features
|
|
33
|
+
|
|
34
|
+
* **Native Graph Formulation**: Uses [FalkorDB](https://falkordb.com/) to store problem definitions (variables, tools, dependencies) as a property graph.
|
|
35
|
+
* **Dynamic Problem Construction**: Automatically translates the graph topology into an executable [OpenMDAO](https://openmdao.org/) problem.
|
|
36
|
+
* **Multi-Fidelity Surrogates**: Integrates [SMT](https://smt.readthedocs.io/en/latest/) for Co-Kriging and other surrogate models.
|
|
37
|
+
* **Constrained Bayesian Optimization**: Leverages [Ax Platform](https://ax.dev/) for robust optimization, easily managing KADMOS multi-objective targets, fidelity, and discrete/continuous parameters.
|
|
38
|
+
|
|
39
|
+
## Project Architecture
|
|
40
|
+
|
|
41
|
+
1. **FalkorDB**: Stores the "Fundamental Problem Graph" (FPG).
|
|
42
|
+
2. **Graph Manager**: Python API to manipulate the graph structure.
|
|
43
|
+
3. **Translator**: Converts the graph into an OpenMDAO System.
|
|
44
|
+
4. **Optimizer**: Drivers (Ax, Pymoo) that execute the OpenMDAO problem holding constraints constant.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
This project uses `uv` for dependency management.
|
|
49
|
+
|
|
50
|
+
1. **Install uv** (if not installed):
|
|
51
|
+
See [astral.sh/uv](https://astral.sh/uv).
|
|
52
|
+
|
|
53
|
+
2. **Clone and Install**:
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://github.com/jultou-raa/GraphMDO.git
|
|
56
|
+
cd GraphMDO
|
|
57
|
+
uv sync
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
3. **FalkorDB**:
|
|
61
|
+
Ensure you have a running FalkorDB instance (e.g., via Docker):
|
|
62
|
+
```bash
|
|
63
|
+
docker run -p 6379:6379 -it falkordb/falkordb
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
### 1. Defining a Problem (Python API)
|
|
69
|
+
|
|
70
|
+
You can programmatically build your MDO problem graph:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from mdo_framework.db.graph_manager import GraphManager
|
|
74
|
+
|
|
75
|
+
gm = GraphManager()
|
|
76
|
+
gm.clear_graph()
|
|
77
|
+
|
|
78
|
+
# Define Variables
|
|
79
|
+
gm.add_variable("x", value=1.0, lower=0.0, upper=10.0)
|
|
80
|
+
gm.add_variable("y", value=2.0, lower=0.0, upper=10.0)
|
|
81
|
+
gm.add_variable("z", value=0.0)
|
|
82
|
+
|
|
83
|
+
# Define Tool
|
|
84
|
+
gm.add_tool("MyTool")
|
|
85
|
+
|
|
86
|
+
# Define Connections
|
|
87
|
+
gm.connect_input_to_tool("x", "MyTool")
|
|
88
|
+
gm.connect_input_to_tool("y", "MyTool")
|
|
89
|
+
gm.connect_tool_to_output("MyTool", "z")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 2. Running Optimization
|
|
93
|
+
|
|
94
|
+
Once the graph is populated, you can run the optimization workflow. You need to provide the actual Python functions corresponding to the tool names in the graph.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from mdo_framework.core.translator import GraphProblemBuilder
|
|
98
|
+
from mdo_framework.optimization.optimizer import BayesianOptimizer, LocalEvaluator
|
|
99
|
+
from mdo_framework.core.topology import TopologicalAnalyzer
|
|
100
|
+
|
|
101
|
+
# Define tool implementation
|
|
102
|
+
def my_tool_func(x, y):
|
|
103
|
+
return x + y # Simple example
|
|
104
|
+
|
|
105
|
+
# Registry maps graph tool names to Python callables
|
|
106
|
+
tool_registry = {
|
|
107
|
+
"MyTool": my_tool_func
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Build OpenMDAO Problem from Graph
|
|
111
|
+
schema = gm.get_graph_schema()
|
|
112
|
+
builder = GraphProblemBuilder(schema)
|
|
113
|
+
prob = builder.build_problem(tool_registry)
|
|
114
|
+
|
|
115
|
+
# Resolve Topology mapping design_vars automatically from KADMOS graph
|
|
116
|
+
analyzer = TopologicalAnalyzer(schema)
|
|
117
|
+
design_vars, _ = analyzer.resolve_dependencies(["z"])
|
|
118
|
+
parameters = analyzer.extract_parameters(design_vars)
|
|
119
|
+
|
|
120
|
+
# Run Optimization
|
|
121
|
+
evaluator = LocalEvaluator(prob)
|
|
122
|
+
optimizer = BayesianOptimizer(
|
|
123
|
+
evaluator=evaluator,
|
|
124
|
+
parameters=parameters,
|
|
125
|
+
objectives=[{"name": "z", "minimize": True}],
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
result = optimizer.optimize(n_steps=10)
|
|
129
|
+
print(f"Best Result: {result['best_objectives']} at {result['best_parameters']}")
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 3. Running Tests
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
uv run pytest tests/
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Contributing
|
|
139
|
+
|
|
140
|
+
1. Follow PEP 8 guidelines.
|
|
141
|
+
2. Ensure 100% test coverage for new features.
|
|
142
|
+
3. Use `uv run pre-commit run --all-files` before committing.
|