question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameters linking issues

See original GitHub issue

Gammapy version 1.0

Bug description The current way of linking parameters (par1 = par2) works only if par2.name is contained in the default_parameters.names list of the model to which par1 belongs. This generates several issues.

For example, I think this should not fail: image

On the other hand, this should fail (since the linked parameters don’t have the same units): image

Fixing this second issue is quite easy: image

Instead for the first example it’s much more tricky. Perhaps something like a LinkedParameter class is needed

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
luca-giunticommented, Dec 8, 2022

OK thanks, we can indeed explore this kind of possibilities.

An alternative solution, that does not require re-thinking too much of the current modeling architecture, is based on a new LinkedParameter class that:

  • takes care of updating the parameter value when needed
  • checks that units are consistent
  • adapts the parameter name to be consistent with the model.default_parameters.names list

As a big bonus, such class can easily be generalized to also accept an operator argument to perform arithmetic operation between parameters, which I think is a nice feature that we don’t currently support. In this case the identity would be just a special case, one could do complex links such as index2 = index1 + 1 or E_break = constant / B**2. Here is an example of this: https://github.com/luca-giunti/share/blob/master/LinkedParameter_Generalized.ipynb

1reaction
maxnoecommented, Dec 8, 2022

@luca-giunti I didn’t mean it as “this should already work” but as the proposed API for how it should work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring issue linking | Administering Jira applications ...
You can link Jira issues with each other to create associations. These Jira issues can be on the same Jira installation or another...
Read more >
open Issues via direct HTML links with parameters - GitLab
Link issues together to show that they're related or that one is blocking others. Learn more. Activity. Sort or filter.
Read more >
An SEO Guide to URL Parameter Handling
URL parameters create duplicate content, waste crawl budget, and dilute ranking signals. Learn six ways to avoid potential SEO issues with ...
Read more >
Common Challenges with Email Links and Tracking Parameters
Another challenge around link tracking for emails is consistency across teams. Because the parameters are often case sensitive, even small ...
Read more >
Create new issue URLs - Linear Guide
The following links trigger the creation of a new Linear issue in any browser and you can add query parameters after any of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found