Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MoSIS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Attention: Maintenance on monday 19.04.2021 from 07:00 - 13:00 (Gitlab and Mattermost are offline!)
Open sidebar
Theresa Pollinger
MoSIS
Commits
4a884f99
Commit
4a884f99
authored
Apr 16, 2018
by
Theresa Pollinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kinda neat ephemeral pdes
parent
b0cf065b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
563 additions
and
348 deletions
+563
-348
interview_kernel/example_interview.ipynb
interview_kernel/example_interview.ipynb
+536
-333
interview_kernel/interview_kernel.py
interview_kernel/interview_kernel.py
+5
-2
interview_kernel/pde_state_machine.py
interview_kernel/pde_state_machine.py
+13
-10
setup.py
setup.py
+9
-3
No files found.
interview_kernel/example_interview.ipynb
View file @
4a884f99
This diff is collapsed.
Click to expand it.
interview_kernel/interview_kernel.py
View file @
4a884f99
...
...
@@ -267,12 +267,15 @@ Otherwise, you can always answer with \LaTeX-type input.
thynames
=
get_recursively
(
self
.
state_machine
.
simdata
,
"theoryname"
)
# if thynames:
# url_args_dict["highlight"] = ",".join(thynames)
# for now, highlight the "persistent ephemeral" theories, cf https://github.com/UniFormal/MMT/issues/326
url_args_dict
[
"highlight"
]
=
"actual*,ephemeral*,u,q,α,SHE"
else
:
model_name
=
self
.
state_machine
.
generate_mpd_theories
()
if
model_name
is
None
:
# Fallback for now, because ephemeral theories are not yet accessible to tgview
if
model_name
is
None
:
model_name
=
"Model"
url_args_dict
=
dict
(
type
=
"mpd"
,
graphdata
=
self
.
state_machine
.
mmtinterface
.
namespace
+
"?"
+
model_name
)
graphdata
=
self
.
state_machine
.
mmtinterface
.
namespace
+
"?"
+
model_name
,
highlight
=
"MPD_pde*"
)
# have the side bars go away
url_args_dict
[
"viewOnlyMode"
]
=
"true"
...
...
interview_kernel/pde_state_machine.py
View file @
4a884f99
...
...
@@ -381,7 +381,8 @@ class PDE_States:
self
.
new_theory
(
parameter_name
)
# we might need the other parameters created so far, so use them
for
otherparamentry
in
string_handling
.
get_recursively
(
self
.
simdata
[
"parameters"
],
"theoryname"
):
self
.
include_in
(
parameter_name
,
otherparamentry
)
if
otherparamentry
in
userstring
:
self
.
include_in
(
parameter_name
,
otherparamentry
)
# sanitize userstring - check if this works for all cases
parsestring
=
string_handling
.
add_ods
(
userstring
)
...
...
@@ -451,12 +452,13 @@ class PDE_States:
subdict
[
"rhsstring_expanded"
]
=
self
.
try_expand
(
subdict
[
"rhsstring"
])
# TODO expand properly
# to make the left-hand side a function on x, place " [ variablename : domainname ] " in front
lambda_x
=
" [ x : "
+
self
.
simdata
[
"domain"
][
"name"
]
+
" ] "
if
"x"
in
parts
[
0
]:
parts
[
0
]
=
" [ x : "
+
self
.
simdata
[
"domain"
][
"name"
]
+
" ] "
+
parts
[
0
]
parts
[
0
]
=
lambda_x
+
parts
[
0
]
# right-hand side: infer type, make function if not one yet
if
not
string_handling
.
type_is_function_from
(
self
.
get_inferred_type
(
subdict
[
"theoryname"
],
parts
[
1
]),
self
.
simdata
[
"domain"
][
"name"
]):
parts
[
1
]
=
" [ x : "
+
self
.
simdata
[
"domain"
][
"name"
]
+
" ] "
+
parts
[
1
]
parts
[
1
]
=
lambda_x
+
parts
[
1
]
# in lhs replace all unknown names used by more generic ones and add lambda clause in front
for
unkname
in
string_handling
.
get_recursively
(
self
.
simdata
[
"unknowns"
],
"theoryname"
):
...
...
@@ -821,18 +823,19 @@ class PDE_States:
self
.
mmtinterface
.
mmt_new_theory
(
mpd_theory_name
)
self
.
include_in
(
mpd_theory_name
,
pde_names
[
pde_number
])
# include all the mpd_unknowns, parameters and bcs
for
unknownentry
in
string_handling
.
get_recursively
(
self
.
simdata
[
"unknowns"
],
"theoryname"
):
self
.
include_in
(
mpd_theory_name
,
"MPD_"
+
unknownentry
)
# include all the mpd_unknowns, and parameters
for
paramentry
in
string_handling
.
get_recursively
(
self
.
simdata
[
"parameters"
],
"theoryname"
):
if
paramentry
in
pde
[
'string'
]:
self
.
include_in
(
mpd_theory_name
,
paramentry
)
self
.
add_list_of_declarations
(
mpd_theory_name
,
[
str
(
"proof_"
+
str
(
pde_number
)
+
" : ⊦ "
+
pde
[
"lhsstring"
]
+
" ≐ "
+
pde
[
"rhsstring"
]
+
string_handling
.
object_delimiter
+
" role Law"
)
])
for
unknownentry
in
string_handling
.
get_recursively
(
self
.
simdata
[
"unknowns"
],
"theoryname"
):
# TODO make more robust + rework for more unknowns
self
.
include_in
(
mpd_theory_name
,
"MPD_"
+
unknownentry
)
self
.
add_list_of_declarations
(
mpd_theory_name
,
[
str
(
"proof_"
+
str
(
pde_number
)
+
" : ⊦ "
+
pde
[
"lhsstring"
].
replace
(
unknownentry
,
" "
+
unknownentry
)
+
" ≐ "
+
pde
[
"rhsparsestring"
]
+
string_handling
.
object_delimiter
+
" role Law"
)
])
with
CriticalSubdict
(
self
.
simdata
[
self
.
state
],
self
.
poutput
):
mpd_theory_name
=
"MPD_bcs"
...
...
setup.py
View file @
4a884f99
# cf. https://pypi.python.org/pypi/twine
# cf. https://pypi.python.org/pypi/twine:
# $ python setup.py sdist bdist_wheel
# $ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# or
# $ twine upload --repository testpypi dist/*
from
setuptools
import
setup
...
...
@@ -13,14 +17,16 @@ setup(
description
=
'A Jupyter kernel that interviews you for a PDE model and
\
transforms it into an ExaStencils simulation.'
,
python_requires
=
">=3.4"
,
# replicating contents of MANIFEST, cf.
# replicating contents of MANIFEST,
# cf.https://stackoverflow.com/questions/7522250/how-to-include-package-data-with-setuptools-distribute/14159430#14159430
package_data
=
{
'interview_kernel/exastencils'
:
[
'interview_kernel/exastencils/compiler.jar'
,
'interview_kernel/exastencils/generate_compile_and_run_list.sh'
,
'interview_kernel/exastencils/lib/*.*'
],
},
zip_safe
=
False
,
# use_scm_version=True,
setup_requires
=
[
'setuptools_scm'
],
setup_requires
=
[
'setuptools_scm'
],
# or possibly https://pypi.python.org/pypi/setuptools-git
install_requires
=
[
'transitions'
,
'bokeh'
,
'requests'
,
'pylatexenc'
,
'metakernel'
,
'lxml'
,
'IPython'
,
'jupyter_client'
,
'ipywidgets'
]
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment