Attention: Maintenance on monday 19.04.2021 from 07:00 - 13:00 (Gitlab and Mattermost are offline!)

Commit 4a884f99 authored by Theresa Pollinger's avatar Theresa Pollinger

kinda neat ephemeral pdes

parent b0cf065b
This diff is collapsed.
......@@ -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"
......
......@@ -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"
......
# 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']
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment