Skip to content

Commit 1aca203

Browse files
authored
Merge pull request #529 from ControlCore-Project/dev
Merge dev to main
2 parents 3b6756b + dccbcd4 commit 1aca203

File tree

155 files changed

+14983
-2635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+14983
-2635
lines changed

.dockerignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Python
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
.Python
10+
env/
11+
venv/
12+
ENV/
13+
.venv/
14+
Pipfile.lock
15+
16+
# Python Build / Distribution
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# C/C++ Build Artifacts
36+
target/
37+
*.o
38+
*.out
39+
*.so
40+
*.dylib
41+
*.dll
42+
CMakeCache.txt
43+
CMakeFiles/
44+
45+
# Testing and Coverage
46+
.tox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
57+
# IDE and OS files
58+
.vscode/
59+
.idea/
60+
*.swp
61+
*.swo
62+
.DS_Store
63+
Thumbs.db
64+
65+
Dockerfile*
66+
docker-compose.yml
67+
.dockerignore

.github/workflows/PR-review.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: AI Code Reviewer
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
issues: write
11+
12+
jobs:
13+
gemini-code-review:
14+
runs-on: ubuntu-latest
15+
if: |
16+
github.event.issue.pull_request &&
17+
contains(github.event.comment.body, '/gemini-review')
18+
steps:
19+
- name: PR Info
20+
env:
21+
#Assign untrusted inputs to environment variables first
22+
COMMENT_BODY: ${{ github.event.comment.body }}
23+
ISSUE_NUM: ${{ github.event.issue.number }}
24+
REPO: ${{ github.repository }}
25+
#Use shell variables ("$VAR") instead of template tags
26+
run: |
27+
echo "Comment: $COMMENT_BODY"
28+
echo "Issue Number: $ISSUE_NUM"
29+
echo "Repository: $REPO"
30+
31+
- name: Checkout Repo
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0
35+
ref: refs/pull/${{ github.event.issue.number }}/head
36+
37+
- name: Get PR Details
38+
id: pr
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
REPO: ${{ github.repository }}
42+
ISSUE_NUM: ${{ github.event.issue.number }}
43+
#Use env vars for the API call to prevent injection
44+
#Use quotes around variables to prevent word splitting
45+
run: |
46+
PR_JSON=$(gh api "repos/$REPO/pulls/$ISSUE_NUM")
47+
echo "head_sha=$(echo "$PR_JSON" | jq -r .head.sha)" >> $GITHUB_OUTPUT
48+
echo "base_sha=$(echo "$PR_JSON" | jq -r .base.sha)" >> $GITHUB_OUTPUT
49+
50+
- uses: truongnh1992/gemini-ai-code-reviewer@main
51+
with:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
54+
GEMINI_MODEL: gemini-2.5-flash
55+
EXCLUDE: "*.md,*.txt,package-lock.json"

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
cache: 'pip'
19+
20+
- name: Install ruff
21+
run: pip install ruff
22+
23+
- name: Check formatting
24+
run: ruff format --check .
25+
26+
- name: Lint
27+
run: ruff check . --output-format=github
28+
29+
test:
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
python-version: ['3.9', '3.10', '3.11', '3.12']
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
cache: 'pip'
42+
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install -r requirements-ci.txt
47+
48+
- name: Run tests
49+
run: |
50+
pytest --tb=short -q \
51+
--cov=concore_cli --cov=concore_base \
52+
--cov-report=term-missing \
53+
--ignore=measurements/ \
54+
--ignore=0mq/ \
55+
--ignore=ratc/ \
56+
--ignore=linktest/
57+
58+
java-test:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- uses: actions/setup-java@v4
64+
with:
65+
distribution: 'temurin'
66+
java-version: '17'
67+
68+
- name: Download jeromq
69+
run: |
70+
curl -fsSL -o jeromq.jar https://repo1.maven.org/maven2/org/zeromq/jeromq/0.6.0/jeromq-0.6.0.jar
71+
72+
- name: Compile Java tests
73+
run: |
74+
javac -cp jeromq.jar concoredocker.java TestLiteralEval.java TestConcoredockerApi.java
75+
76+
- name: Run Java tests
77+
run: |
78+
java -cp .:jeromq.jar TestLiteralEval
79+
java -cp .:jeromq.jar TestConcoredockerApi
80+
81+
docker-build:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- name: Check if Dockerfile.py changed
87+
uses: dorny/paths-filter@v3
88+
id: filter
89+
with:
90+
filters: |
91+
dockerfile:
92+
- 'Dockerfile.py'
93+
- 'requirements.txt'
94+
95+
- name: Validate Dockerfile build
96+
if: steps.filter.outputs.dockerfile == 'true'
97+
run: docker build -f Dockerfile.py -t concore-py-test .

.github/workflows/greetings.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Greetings
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
issues:
7+
types: [opened]
8+
9+
jobs:
10+
greeting:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/first-interaction@v3
17+
with:
18+
repo_token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
issue_message: |
21+
👋 Welcome to the CONTROL-CORE Project, @${{ github.actor }}! Thank you for opening your first issue in concore.
22+
We appreciate your contribution to the organization and will review it as soon as possible.
23+
24+
Before we get started, please check out these resources:
25+
- 📚 [Project Documentation](https://control-core.readthedocs.io/)
26+
- 📘 [Contribution Guidelines](https://github.com/ControlCore-Project/concore/blob/main/CONTRIBUTING.md)
27+
- 📜 [Code of Conduct](https://github.com/ControlCore-Project/concore/blob/main/CODE_OF_CONDUCT.md)
28+
29+
pr_message: |
30+
🎉 Welcome aboard, @${{ github.actor }}! Thank you for your first pull request in concore.
31+
32+
Please ensure that you are contributing to the **dev** branch.
33+
34+
Your contribution means a lot to us. We'll review it shortly.
35+
36+
Please ensure you have reviewed our:
37+
- 📚 [Project Documentation](https://control-core.readthedocs.io/)
38+
- 📘 [Contribution Guidelines](https://github.com/ControlCore-Project/concore/blob/main/CONTRIBUTING.md)
39+
- 📜 [Code of Conduct](https://github.com/ControlCore-Project/concore/blob/main/CODE_OF_CONDUCT.md)
40+
41+
If you have any questions, feel free to ask. Happy coding!

.gitignore

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
**/.DS_Store
1+
# Python bytecode/cache
2+
__pycache__/
3+
*.pyc
4+
*.pyo
5+
*.pyd
6+
*.py[cod]
7+
*.class
8+
*.so
9+
.Python
10+
11+
# Virtual environments
12+
venv/
13+
env/
14+
ENV/
15+
.env/
16+
.venv/
17+
18+
# IDE
19+
.vscode/
20+
.idea/
21+
22+
# Build/packaging
23+
*.egg-info/
24+
dist/
25+
build/
26+
27+
# Testing
28+
.pytest_cache/
29+
htmlcov/
30+
.coverage
31+
32+
# Concore specific
33+
concorekill.bat
34+
35+
.claude
36+
.codex
37+
.cursor
38+
_bmad

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.11.12
4+
hooks:
5+
- id: ruff
6+
args: [--output-format=full]
7+
- id: ruff-format

0mq/comm_node.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import concore
2-
import concore2
32

43
concore.delay = 0.07
5-
concore2.delay = 0.07
6-
concore2.inpath = concore.inpath
7-
concore2.outpath = concore.outpath
8-
concore2.simtime = 0
4+
concore.simtime = 0
95
concore.default_maxtime(100)
106
init_simtime_u = "[0.0, 0.0, 0.0]"
117
init_simtime_ym = "[0.0, 0.0, 0.0]"
128

139
u = concore.initval(init_simtime_u)
14-
ym = concore2.initval(init_simtime_ym)
15-
while(concore2.simtime<concore.maxtime):
10+
ym = concore.initval(init_simtime_ym)
11+
while(concore.simtime<concore.maxtime):
1612
while concore.unchanged():
1713
u = concore.read(concore.iport['U'],"u",init_simtime_u)
1814
concore.write(concore.oport['U1'],"u",u)
1915
print(u)
20-
old2 = concore2.simtime
21-
while concore2.unchanged() or concore2.simtime <= old2:
22-
ym = concore2.read(concore.iport['Y1'],"ym",init_simtime_ym)
23-
concore2.write(concore.oport['Y'],"ym",ym)
24-
print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore2.simtime))
16+
old2 = float(concore.simtime)
17+
while concore.unchanged() or concore.simtime <= old2:
18+
ym = concore.read(concore.iport['Y1'],"ym",init_simtime_ym)
19+
concore.write(concore.oport['Y'],"ym",ym)
20+
print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore.simtime))
2521
print("retry="+str(concore.retrycount))

0 commit comments

Comments
 (0)