Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sumpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
sumpy
Commits
d46ff930
There was a problem fetching the pipeline summary.
Commit
d46ff930
authored
8 years ago
by
Matt Wala
Browse files
Options
Downloads
Patches
Plain Diff
Pull magic string out.
parent
d9073204
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!26
Initial SymEngine integration.
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sumpy/symbolic.py
+6
-4
6 additions, 4 deletions
sumpy/symbolic.py
with
6 additions
and
4 deletions
sumpy/symbolic.py
+
6
−
4
View file @
d46ff930
...
@@ -47,21 +47,23 @@ def _find_symbolic_backend():
...
@@ -47,21 +47,23 @@ def _find_symbolic_backend():
symengine_found
=
False
symengine_found
=
False
ALLOWED_BACKENDS
=
(
"
sympy
"
,
"
symengine
"
)
# noqa
ALLOWED_BACKENDS
=
(
"
sympy
"
,
"
symengine
"
)
# noqa
BACKEND_ENV_VAR
=
"
SUMPY_FORCE_SYMBOLIC_BACKEND
"
# noqa
import
os
import
os
backend
=
os
.
environ
.
get
(
"
SUMPY_FORCE_SYMBOLIC_BACKEND
"
)
backend
=
os
.
environ
.
get
(
BACKEND_ENV_VAR
)
if
backend
is
not
None
:
if
backend
is
not
None
:
if
backend
not
in
ALLOWED_BACKENDS
:
if
backend
not
in
ALLOWED_BACKENDS
:
raise
RuntimeError
(
raise
RuntimeError
(
"
SUMPY_FORCE_SYMBOLIC_BACKEND
value is unrecognized:
'
%s
'
"
"
%s
value is unrecognized:
'
%s
'
"
"
(allowed values are %s)
"
%
(
"
(allowed values are %s)
"
%
(
BACKEND_ENV_VAR
,
backend
,
backend
,
"
,
"
.
join
(
"'
%s
'"
%
val
for
val
in
ALLOWED_BACKENDS
)))
"
,
"
.
join
(
"'
%s
'"
%
val
for
val
in
ALLOWED_BACKENDS
)))
if
backend
==
"
symengine
"
and
not
symengine_found
:
if
backend
==
"
symengine
"
and
not
symengine_found
:
from
warnings
import
warn
from
warnings
import
warn
warn
(
"
SUMPY_FORCE_SYMBOLIC_BACKEND
=symengine was specified, but
"
warn
(
"
%s
=symengine was specified, but
could not find symengine.
"
"
could not find symengine. Using sympy.
"
,
RuntimeWarning
)
"
Using sympy.
"
%
BACKEND_ENV_VAR
,
RuntimeWarning
)
USE_SYMENGINE
=
backend
==
"
symengine
"
and
symengine_found
USE_SYMENGINE
=
backend
==
"
symengine
"
and
symengine_found
else
:
else
:
...
...
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