Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
55fb78ad
Commit
55fb78ad
authored
4 months ago
by
Frederik Hennig
Committed by
Christoph Alt
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix mutable-default bug in codegen.config with Python 3.11 and newer
parent
e759f768
No related branches found
No related tags found
1 merge request
!448
Fix mutable-default bug in codegen.config with Python 3.11 and newer
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+24
-13
24 additions, 13 deletions
.gitlab-ci.yml
noxfile.py
+1
-1
1 addition, 1 deletion
noxfile.py
src/pystencils/codegen/config.py
+8
-4
8 additions, 4 deletions
src/pystencils/codegen/config.py
with
33 additions
and
18 deletions
.gitlab-ci.yml
+
24
−
13
View file @
55fb78ad
...
@@ -276,20 +276,9 @@ typecheck:
...
@@ -276,20 +276,9 @@ typecheck:
# -------------------- Unit Tests ---------------------------------------------------------------------
# -------------------- Unit Tests ---------------------------------------------------------------------
# Normal test - runs on every commit all but "long run" tests
.testsuite-base
:
tests-and-coverage
:
stage
:
"
Unit
Tests"
stage
:
"
Unit
Tests"
needs
:
[]
needs
:
[]
image
:
i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:ubuntu24.04-cuda12.6
script
:
-
mkdir -p ~/.config/matplotlib
-
echo "backend:template" > ~/.config/matplotlib/matplotlibrc
-
mkdir public
-
nox --session "testsuite(cupy12)"
tags
:
-
docker
-
cuda11
-
AVX
coverage
:
/Total coverage:\s\d+.\d+\%/
coverage
:
/Total coverage:\s\d+.\d+\%/
artifacts
:
artifacts
:
when
:
always
when
:
always
...
@@ -302,6 +291,28 @@ tests-and-coverage:
...
@@ -302,6 +291,28 @@ tests-and-coverage:
path
:
coverage.xml
path
:
coverage.xml
junit
:
report.xml
junit
:
report.xml
"
testsuite-gpu-py3.10"
:
extends
:
.testsuite-base
image
:
i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:ubuntu24.04-cuda12.6
script
:
-
mkdir -p ~/.config/matplotlib
-
echo "backend:template" > ~/.config/matplotlib/matplotlibrc
-
mkdir public
-
nox --session "testsuite-3.10(cupy12)"
tags
:
-
docker
-
cuda11
-
AVX
"
testsuite-cpu-py3.13"
:
extends
:
.testsuite-base
image
:
i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:alpine
script
:
-
nox --session "testsuite-3.13(cpu)"
tags
:
-
docker
-
AVX
# -------------------- Documentation ---------------------------------------------------------------------
# -------------------- Documentation ---------------------------------------------------------------------
...
@@ -322,7 +333,7 @@ build-documentation:
...
@@ -322,7 +333,7 @@ build-documentation:
pages
:
pages
:
image
:
alpine:latest
image
:
alpine:latest
stage
:
deploy
stage
:
deploy
needs
:
[
"
tests
-and-coverage
"
,
"
build-documentation"
]
needs
:
[
"
tests
uite-gpu-py3.10
"
,
"
build-documentation"
]
script
:
script
:
-
mv docs/build/html public
-
mv docs/build/html public
-
mv coverage_report public/coverage_report
-
mv coverage_report public/coverage_report
...
...
This diff is collapsed.
Click to expand it.
noxfile.py
+
1
−
1
View file @
55fb78ad
...
@@ -86,8 +86,8 @@ def typecheck(session: nox.Session):
...
@@ -86,8 +86,8 @@ def typecheck(session: nox.Session):
session
.
run
(
"
mypy
"
,
"
src/pystencils
"
)
session
.
run
(
"
mypy
"
,
"
src/pystencils
"
)
@nox.session
(
python
=
[
"
3.10
"
,
"
3.12
"
,
"
3.13
"
],
tags
=
[
"
test
"
])
@nox.parametrize
(
"
cupy_version
"
,
[
None
,
"
12
"
,
"
13
"
],
ids
=
[
"
cpu
"
,
"
cupy12
"
,
"
cupy13
"
])
@nox.parametrize
(
"
cupy_version
"
,
[
None
,
"
12
"
,
"
13
"
],
ids
=
[
"
cpu
"
,
"
cupy12
"
,
"
cupy13
"
])
@nox.session
(
python
=
"
3.10
"
,
tags
=
[
"
test
"
])
def
testsuite
(
session
:
nox
.
Session
,
cupy_version
:
str
|
None
):
def
testsuite
(
session
:
nox
.
Session
,
cupy_version
:
str
|
None
):
if
cupy_version
is
not
None
:
if
cupy_version
is
not
None
:
install_cupy
(
session
,
cupy_version
,
skip_if_no_cuda
=
True
)
install_cupy
(
session
,
cupy_version
,
skip_if_no_cuda
=
True
)
...
...
This diff is collapsed.
Click to expand it.
src/pystencils/codegen/config.py
+
8
−
4
View file @
55fb78ad
...
@@ -196,12 +196,16 @@ class Category(Generic[Category_T]):
...
@@ -196,12 +196,16 @@ class Category(Generic[Category_T]):
def
__get__
(
self
,
obj
:
ConfigBase
,
objtype
:
type
[
ConfigBase
]
|
None
=
None
)
->
Category_T
:
def
__get__
(
self
,
obj
:
ConfigBase
,
objtype
:
type
[
ConfigBase
]
|
None
=
None
)
->
Category_T
:
if
obj
is
None
:
if
obj
is
None
:
return
self
.
_default
return
None
return
cast
(
Category_T
,
getattr
(
obj
,
self
.
_lookup
,
None
))
cat
=
getattr
(
obj
,
self
.
_lookup
,
None
)
if
cat
is
None
:
cat
=
self
.
_default
.
copy
()
setattr
(
obj
,
self
.
_lookup
,
cat
)
return
cast
(
Category_T
,
cat
)
def
__set__
(
self
,
obj
:
ConfigBase
,
cat
:
Category_T
):
def
__set__
(
self
,
obj
:
ConfigBase
,
cat
:
Category_T
|
None
):
setattr
(
obj
,
self
.
_lookup
,
cat
.
copy
())
setattr
(
obj
,
self
.
_lookup
,
cat
.
copy
()
if
cat
is
not
None
else
None
)
class
_AUTO_TYPE
:
...
# noqa: E701
class
_AUTO_TYPE
:
...
# noqa: E701
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment