Making workspaces immutable?
See original GitHub issueQuestion
Currently workspaces are mutable:
import pyhf
spec = {
"channels": [
{
"name": "Signal Region",
"samples": [
{
"data": [10],
"modifiers": [
{"data": [1], "name": "staterror_Signal-Region", "type": "staterror"},
{"data": None, "name": "Signal strength", "type": "normfactor"},
],
"name": "Signal",
}
],
}
],
"measurements": [
{
"config": {
"parameters": [{"name": "staterror_Signal-Region", "fixed": True, "inits": [1.1]}],
"poi": "Signal strength",
},
"name": "fit",
}
],
"observations": [{"data": [475], "name": "Signal Region"}],
"version": "1.0.0",
}
ws = pyhf.Workspace(spec)
model = ws.model()
print(model.config.suggested_init()) # -> [1.1, 1.0]
spec["measurements"][0]["config"]["parameters"][0]["inits"] = [1.2]
print(model.config.suggested_init()) # -> [1.1, 1.0]
model = ws.model()
print(model.config.suggested_init()) # -> [1.2, 1.0]
Models on the other hand are immutable. What do you think about making workspaces immutable as well? While I do not have a concrete example in mind, I imagine it could prevent some difficult-to-debug scenarios where the workspace changes without the user noticing.
Relevant Issues and Pull Requests
none
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
[Feature] "yarn workspaces focus" option --immutable #1803
I'd be willing to implement this feature This feature can already be implemented through a plugin - the workspace-tools plugin in this repo....
Read more >Are Travis Workspaces immutable? - Travis CI Community
Hi, I'm not sure whether the following “problem” is by design or rather a bug, but either way it is undocumented or at...
Read more >Immutable offers workspace flexibility at WeWork to drive ...
Immutable offers workspace flexibility at WeWork to drive global expansion ... Immutable is creating a destination for people to achieve ...
Read more >How to build immutable servers fast - TechBeacon
The time it takes to make a change through immutable servers can be a challenge. I'm going to share some techniques for keeping...
Read more >Efficient workspace: type or immutable? - Julia Discourse
Question: Should WorkSpace be an immutable composite ( immutable ) or ... in which case immutable makes it much cheaper to store in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I thiink a simple change like
should suffice
@lukasheinrich Sorry hadn’t taken the time to read all the other replies when I copy pasted that in. That would be great.