Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.11.0 #54

Merged
merged 50 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
08b6861
debugging notebook plotting
danbryce Nov 4, 2024
ca8e43c
Merge branch 'develop' into sep-monthly-demo
danbryce Nov 4, 2024
c360d7b
improved output of demo abstraction notebook
danbryce Nov 4, 2024
b4f38ce
Merge branch 'sep-monthly-demo' into develop
danbryce Nov 4, 2024
852a8e2
add support for reserved characters in models
danbryce Nov 11, 2024
f9939fa
Merge pull request #52 from siftech/state-chars-bug
danbryce Nov 12, 2024
03a4b4f
test instance
danbryce Nov 12, 2024
2f15440
Merge branch 'holly' into develop
danbryce Nov 12, 2024
31c81df
fix issue with contracting model parameters by limiting to last time …
danbryce Nov 13, 2024
867e6f9
Fix contract model output
danbryce Nov 14, 2024
5105a1b
fix contract
danbryce Nov 14, 2024
5fa3a24
Merge branch 'fix-contract' into develop
danbryce Nov 15, 2024
7ce2d9b
test case
danbryce Nov 15, 2024
9b73c48
support float timepoints
danbryce Nov 18, 2024
926f8d6
support floating point timepoints
danbryce Nov 19, 2024
1d10009
fixed unsat core parsing with float timepoint
danbryce Nov 19, 2024
b02120f
Merge branch 'float-time' into develop
danbryce Nov 19, 2024
dc6aa83
checkpoint on abstraction
danbryce Dec 3, 2024
63637ec
fixes to test
danbryce Dec 3, 2024
4c1f505
generalized stratification and abstraction
danbryce Dec 18, 2024
649a34c
modify addition of probabilities to transitions
danbryce Dec 30, 2024
a3fb9c5
fix test
danbryce Dec 31, 2024
486fc6e
fix tests
danbryce Dec 31, 2024
175a610
streamline parameters
danbryce Jan 7, 2025
03b8794
fix tests
danbryce Jan 8, 2025
2cff7f6
remove abstract probability terms
danbryce Jan 17, 2025
b138577
analysis test
danbryce Jan 21, 2025
34c2b04
format
danbryce Jan 21, 2025
2c92958
fix test, normalize after abstraction
danbryce Jan 21, 2025
149fcb6
testing mods
danbryce Jan 21, 2025
9032ddb
Merge remote-tracking branch 'origin/stratify-fix' into stratify-fix
danbryce Jan 21, 2025
6dbde05
debug test
danbryce Jan 21, 2025
d34c4a4
runtime analysis cases
danbryce Jan 23, 2025
67f3687
age strata and bug fix
danbryce Jan 24, 2025
4532995
modify sim for runtime calc
danbryce Jan 24, 2025
042fa46
setup observable for common constraint on mode formulations
danbryce Jan 25, 2025
596ee49
general grouping of strata levels
danbryce Jan 25, 2025
d92dbbc
partition self transitions
danbryce Jan 27, 2025
8c147ab
setup observable for common constraint on mode formulations
danbryce Jan 27, 2025
5edefbc
checkpoint
danbryce Jan 27, 2025
cf51ca8
Merge remote-tracking branch 'origin/stratify-fix' into stratify-fix
danbryce Jan 27, 2025
af8717d
checkpoint
danbryce Jan 28, 2025
4d7cd49
fix issues with partitioned strata
danbryce Jan 29, 2025
531ae20
fix multi attribute strat/abst
danbryce Jan 30, 2025
2c601cc
fix tests
danbryce Jan 31, 2025
5b72844
setup scaling tests
danbryce Jan 31, 2025
f0da656
running analysis, needs tweaks
danbryce Jan 31, 2025
716bae5
Merge remote-tracking branch 'origin/main' into develop
danbryce Feb 1, 2025
83b5d19
Merge branch 'stratify-fix' into develop
danbryce Feb 1, 2025
6137dcf
bump version
danbryce Feb 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "1.10.0"
__version__ = "1.11.0"
2 changes: 1 addition & 1 deletion auxiliary_packages/funman_demo/src/funman_demo/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "1.10.0"
__version__ = "1.11.0"
42 changes: 39 additions & 3 deletions auxiliary_packages/funman_demo/src/funman_demo/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

from funman import (
Expand Down Expand Up @@ -163,16 +164,22 @@ def relax_parameter_bounds(funman_request, factor=0.1):
interval.ub = interval.ub + (factor / 2 * width)


def plot_last_point(results, states):
def plot_last_point(results, states, plot_logscale=False):
pts = results.parameter_space.points()
print(f"{len(pts)} points")

if len(pts) > 0:
# Get a plot for last point
df = results.dataframe(points=pts[-1:])
# pd.options.plotting.backend = "plotly"
for s in states:
df[s] = df[s].mask(np.isinf)

ax = df[states].plot()

if plot_logscale:
ax.set_yscale("symlog")

fig = plt.figure()
# fig.set_yscale("log")
# fig.savefig("save_file_name.pdf")
Expand All @@ -196,12 +203,41 @@ def pretty_print_request_params(params):
print(df.T)


def report(results, name, states, request_results, request_params):
def runtime_stats_dataframe(request_params):
df = pd.DataFrame(request_params).T
df.index.name = "Model"
df = (
df[["model_size", "total_time", "time_horizon"]]
.rename(
columns={
"model_size": "Model Size",
"total_time": "Total Time",
"time_horizon": "Time Horizon",
}
)
.sort_index()
)
return df


def report(
results,
name,
states,
request_results,
request_params,
plot_logscale=False,
plot=True,
):
request_results[name] = results
plot_last_point(results, states)
if plot:
plot_last_point(results, states, plot_logscale=plot_logscale)
param_values = get_last_point_parameters(results)
# print(f"Point parameters: {param_values}")
if param_values is not None:
param_values["total_time"] = results.timing.total_time
param_values["model_size"] = results.model.num_elements()
param_values["time_horizon"] = results.time_horizon()
request_params[name] = param_values
pretty_print_request_params(request_params)

Expand Down
4 changes: 3 additions & 1 deletion auxiliary_packages/funman_demo/src/funman_demo/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def summarize_results(
boxes = (
results.parameter_space.boxes()
if not print_last_time
else results.parameter_space.last_boxes()
else results.parameter_space.last_boxes(
steps=[results.parameter_space.last_step()]
)
)

if parameters_to_plot is None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "1.10.0"
__version__ = "1.11.0"
9 changes: 6 additions & 3 deletions auxiliary_packages/funman_dreal/src/funman_dreal/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
)
from pysmt.walkers import DagWalker

from funman.utils.smtlib_utils import str_smtlib

l = logging.getLogger(__name__)


Expand Down Expand Up @@ -119,15 +121,15 @@ def __init__(self, env=None):
r"(-?\d+\.\d+e-?\d+)", self.real_constant, True
), # decimals scientific
]
+ self.rules[0:-1]
+ self.rules[0:-2]
+ [
Rule(
r"(([A-Za-z_]|[^\u0000-\u007F])([A-Za-z_]|[^\u0000-\u007F])*)",
r"(([A-Za-z_]|[^\u0000-\u007F])([\w\.\{\}_]|[^\u0000-\u007F])*)",
self.identifier,
True,
), # unicode identifiers
]
+ self.rules[-1:]
+ self.rules[-2:]
)
self.compile()

Expand Down Expand Up @@ -218,6 +220,7 @@ def back(self, dreal_formula: dreal.Formula) -> FNode:
)
new_symbols = self.create_dreal_symbols(str(dreal_formula))
formula = CoreParser().parse(str(dreal_formula))
l.debug(f"Extracted SMTLib: {str_smtlib(formula)}")
except Exception as e:
raise e
return formula
Expand Down
2 changes: 1 addition & 1 deletion auxiliary_packages/pde2petri/src/pde2petri/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.10.0"
__version__ = "1.11.0"
2 changes: 1 addition & 1 deletion docker/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ variable "DREAL_REPO_URL" {
default = "https://github.com/danbryce/dreal4.git"
}
variable "DREAL_COMMIT_TAG" {
default = "03a1055c7768ba609f33897ad91c361da6582871"
default = "acc5a255e0245f05458b1041a4e163c11e89880e"
}
variable "AUTOMATES_COMMIT_TAG" {
default = "e5fb635757aa57007615a75371f55dd4a24851e0"
Expand Down
1,330 changes: 891 additions & 439 deletions notebooks/abstraction-bounding-demo.ipynb

Large diffs are not rendered by default.

Loading