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

Add support for parameter tables #33

Merged
merged 87 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
0187be1
First working demo
SimonHeybrock Jul 28, 2023
80d079b
Remove unused
SimonHeybrock Jul 28, 2023
3031bc5
More complex examples (zip!)
SimonHeybrock Jul 28, 2023
247674f
Avoid issue with declaring function in loop
SimonHeybrock Jul 28, 2023
6e4a507
Cleanup
SimonHeybrock Jul 28, 2023
e8a28ec
Add "product" example
SimonHeybrock Jul 31, 2023
3976ab4
Do not use keyword args
SimonHeybrock Jul 31, 2023
6281f16
Prepare for Pipeline integration
SimonHeybrock Jul 31, 2023
2634ee1
Add support for indices to Pipeline
SimonHeybrock Jul 31, 2023
9b1b6be
Cleanup
SimonHeybrock Jul 31, 2023
7167a43
Remove replcaed prototype
SimonHeybrock Jul 31, 2023
6313d03
How to visualize variadic graphs?
SimonHeybrock Jul 31, 2023
bc4acaf
Try compact visualization
SimonHeybrock Jul 31, 2023
5f8f32b
Cleanup
SimonHeybrock Aug 1, 2023
918423e
Switch from nested labeling to Label tuples
SimonHeybrock Aug 1, 2023
e970da7
Begin refactor to param table instead of bare index
SimonHeybrock Aug 2, 2023
aee9407
Readability
SimonHeybrock Aug 2, 2023
e0875c7
Support diamond dependency on same index
SimonHeybrock Aug 2, 2023
4fda7cd
Remove old API
SimonHeybrock Aug 2, 2023
267d7d9
Add ParamTable
SimonHeybrock Aug 2, 2023
de81ba8
Check index length
SimonHeybrock Aug 2, 2023
37f24a1
Prevent breaking set_param_table
SimonHeybrock Aug 2, 2023
d3a56ea
Simplify code
SimonHeybrock Aug 2, 2023
f238948
Refactor remaining tests
SimonHeybrock Aug 2, 2023
9cc8988
Remove unused
SimonHeybrock Aug 2, 2023
cddc86f
Map->Series
SimonHeybrock Aug 2, 2023
643b13d
Some mypy fixes
SimonHeybrock Aug 2, 2023
d89ae31
Test with multiple param tables
SimonHeybrock Aug 2, 2023
d62bb7c
Test mixing generics with param tables
SimonHeybrock Aug 2, 2023
56cd560
More tests
SimonHeybrock Aug 2, 2023
2c07aea
Some cleanup
SimonHeybrock Aug 2, 2023
d3b73d4
Remove visualize from test
SimonHeybrock Aug 2, 2023
5817b71
Test actual diamond
SimonHeybrock Aug 2, 2023
0879ade
Test getting nested series
SimonHeybrock Aug 3, 2023
f7bf30d
Manuel "groupby"
SimonHeybrock Aug 3, 2023
a68da1b
Rename
SimonHeybrock Aug 3, 2023
ec65f77
Support "groupby"-like operation
SimonHeybrock Aug 3, 2023
4316338
Fix use of wrong labels
SimonHeybrock Aug 3, 2023
4672819
Attempt cleanup
SimonHeybrock Aug 3, 2023
9f33650
Extract Grouper
SimonHeybrock Aug 3, 2023
dcb6aee
Avoid clashing name
SimonHeybrock Aug 4, 2023
762097f
Some more complex tests, uncovering issues with group indices
SimonHeybrock Aug 4, 2023
d06c9db
Fix index zip in groupby ops
SimonHeybrock Aug 4, 2023
14d9e9c
Use actual indices for keys
SimonHeybrock Aug 7, 2023
22e9a35
Require unique index in ParamTable
SimonHeybrock Aug 7, 2023
3288d6b
Update visualize
SimonHeybrock Aug 7, 2023
4be8c6c
Split Grouper to make design better for mypy
SimonHeybrock Aug 7, 2023
9672c29
Add param table docs
SimonHeybrock Aug 7, 2023
5e82bea
Cleanup
SimonHeybrock Aug 7, 2023
d9fdc16
Some mypy fixes
SimonHeybrock Aug 7, 2023
a1259bc
More mypy
SimonHeybrock Aug 7, 2023
9be394c
Fix most mypy
SimonHeybrock Aug 7, 2023
a0772d3
Fix mypy
SimonHeybrock Aug 8, 2023
cd62fe9
Remove submodule with non-public functionality
SimonHeybrock Aug 8, 2023
5f6a560
Docstrings
SimonHeybrock Aug 8, 2023
7aa2720
Update docs
SimonHeybrock Aug 8, 2023
baa1c40
Avoid hard-coding names of objects
SimonHeybrock Aug 8, 2023
10e2bcc
Remove old test file
SimonHeybrock Aug 8, 2023
3a48aa7
Comment complicated algorithm
SimonHeybrock Aug 8, 2023
678ef5b
Spelling
SimonHeybrock Aug 8, 2023
d9127db
Grammar
SimonHeybrock Aug 8, 2023
2aaebf1
Improve readability, default to non-compact graph formatting
SimonHeybrock Aug 8, 2023
d001116
Fix type hints
SimonHeybrock Aug 8, 2023
cc58b6f
Do not draw box3d unless compact
SimonHeybrock Aug 8, 2023
0f109fb
Use examples in docs that would pass mypy
SimonHeybrock Aug 8, 2023
7af8fc5
Forbid providing Series directly
SimonHeybrock Aug 8, 2023
14f1439
Apply suggestions from code review
SimonHeybrock Aug 8, 2023
e4c8472
Use py38 syntax
SimonHeybrock Aug 8, 2023
2198467
Rename param name
SimonHeybrock Aug 8, 2023
ade5f50
Use cleared field name
SimonHeybrock Aug 8, 2023
e7ff685
Remove impl. detail test
SimonHeybrock Aug 8, 2023
3e9d4ac
Clarify docstring
SimonHeybrock Aug 8, 2023
243ff9d
Do not rely on string matching
SimonHeybrock Aug 9, 2023
9810581
Rename test file
SimonHeybrock Aug 9, 2023
0e0e75d
WIP refactor
SimonHeybrock Aug 9, 2023
a4ba895
Simplify
SimonHeybrock Aug 9, 2023
395f088
Cleanup
SimonHeybrock Aug 9, 2023
b08c9e7
More cleanup
SimonHeybrock Aug 9, 2023
95781f2
Fix type hints
SimonHeybrock Aug 9, 2023
ab9b473
Readability
SimonHeybrock Aug 9, 2023
c41fbd8
Use more common code
SimonHeybrock Aug 9, 2023
6d28ea9
Fix compact flag
SimonHeybrock Aug 9, 2023
23f7f37
Use alias
SimonHeybrock Aug 10, 2023
cc343fa
Illustrate complicated algorithm
SimonHeybrock Aug 10, 2023
26856e0
Improve docstrings
SimonHeybrock Aug 11, 2023
0a51b70
typo
SimonHeybrock Aug 11, 2023
cc98092
Update src/sciline/pipeline.py
SimonHeybrock Aug 11, 2023
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
2 changes: 2 additions & 0 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
:template: class-template.rst
:recursive:

ParamTable
Pipeline
Scope
Series
scheduler.Scheduler
scheduler.DaskScheduler
scheduler.NaiveScheduler
Expand Down
10 changes: 7 additions & 3 deletions docs/user-guide/getting-started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
"from typing import NewType\n",
"import sciline\n",
"\n",
"_fake_filesytem = {'data.txt': [1, 2, float('nan'), 3]}\n",
"\n",
"\n",
"# 1. Define domain types\n",
"\n",
"Filename = NewType('Filename', str)\n",
Expand All @@ -115,19 +118,20 @@
"\n",
"def load(filename: Filename) -> RawData:\n",
" \"\"\"Load the data from the filename.\"\"\"\n",
" return {'data': [1, 2, float('nan'), 3], 'meta': {'filename': filename}}\n",
" data = _fake_filesytem[filename]\n",
" return RawData({'data': data, 'meta': {'filename': filename}})\n",
"\n",
"\n",
"def clean(raw_data: RawData) -> CleanedData:\n",
" \"\"\"Clean the data, removing NaNs.\"\"\"\n",
" import math\n",
"\n",
" return [x for x in raw_data['data'] if not math.isnan(x)]\n",
" return CleanedData([x for x in raw_data['data'] if not math.isnan(x)])\n",
"\n",
"\n",
"def process(data: CleanedData, param: ScaleFactor) -> Result:\n",
" \"\"\"Process the data, multiplying the sum by the scale factor.\"\"\"\n",
" return sum(data) * param\n",
" return Result(sum(data) * param)\n",
"\n",
"\n",
"# 3. Create pipeline\n",
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ maxdepth: 2
---

getting-started
parameter-tables
```
Loading