Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickStats
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Alkaid Cheng
QuickStats
Merge requests
!92
framework development
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
framework development
dev2
into
master
Overview
0
Commits
7
Pipelines
2
Changes
10
Merged
Alkaid Cheng
requested to merge
dev2
into
master
2 years ago
Overview
0
Commits
7
Pipelines
2
Changes
10
Expand
0
0
Merge request reports
Compare
master
version 1
5402c17e
2 years ago
master (base)
and
latest version
latest version
2f0e6acc
7 commits,
2 years ago
version 1
5402c17e
6 commits,
2 years ago
10 files
+
204
−
148
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
quickstats/analysis/sample_poly_param_tool.py
+
3
−
2
Options
from
typing
import
List
,
Dict
,
Optional
,
Union
from
quickstats
import
AbstractObject
from
quickstats
import
AbstractObject
,
semistaticmethod
from
quickstats.maths.numerics
import
to_rounded_float
,
str_encode_value
from
quickstats.utils.common_utils
import
in_notebook
@@ -27,6 +27,7 @@ class SamplePolyParamTool(AbstractObject):
basis_symbols
[
basis
]
=
Symbol
(
basis
)
return
parameter_symbols
,
coefficient_symbols
,
basis_symbols
@semistaticmethod
def
initialize_formula
(
self
,
formula_str
:
str
,
parameters
:
Dict
,
coefficients
:
Dict
,
latex_map
:
Optional
[
Dict
]
=
None
):
from
sympy
import
simplify
@@ -136,7 +137,7 @@ class SamplePolyParamTool(AbstractObject):
self
.
stdout
.
info
(
"
Coefficients:
"
,
bare
=
True
)
self
.
display_sets
(
*
coefficient_symbols
.
values
())
solutions
=
self
.
solve_coefficients
(
formula_expr
,
parameter_symbols
,
coefficient_symbols
,
basis_symbols
,
basis_value_map
)
basis_symbols
,
basis_value_map
)
if
len
(
solutions
)
==
0
:
raise
RuntimeError
(
"
unable to solve the system of linear equations
"
)
elif
len
(
solutions
)
>
1
:
Loading