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.

Gammapy code organisation

See original GitHub issue

This is a first attempt at a diagram to illustrate Gammapy code organisation.

gammapy-organisation

After some discussion / improvements / code re-organisation I plan to add it to the Gammapy docs and the paper.

At the moment it only shows which sub-packages are lower or higher level. The idea is that a given package is only allowed to import from lower-level packages to avoid circular imports. There are some exceptions, like e.g. gammapy.data does import higher-level classes in factory functions using delayed imports. I’m not sure if it’s desirable / possible to try to avoid this completely. One more aspect: e.g. for spectral analysis we probably want to sometimes extract a spectrum out of a diffuse spectral model cube (e.g. for Fermi-LAT), i.e. functions from lower-level modules can take objects from higher-level package as inputs.

Some ideas to make the diagram better:

  • Add public sub-sub packages, like gammapy.spectrum.models or all packages in gammapy.utils to the diagram.
  • We could try and add a one-line description for each sub-package, although I don’t think this would work well (too much text).
  • We could try to draw connecting lines for all dependencies that are actually there (e.g. astro doesn’t depend on most of the lower-level sub-packages. I don’t think this will work well … too many lines.

There’s a lot of work / cleanup to do. I’ll continue with this in a few weeks.

I have one concrete question: OK to dissolve gammapy.morphology, and introducing gammapy.image.models?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
adonathcommented, Jul 19, 2016

👍 to dissolve gammapy.morphology and introduce gammapy.image.models. I think this makes the structure of gammapy more consistent.

0reactions
cdeilcommented, Jul 5, 2019

Discussion will continue in #2274

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gammapy — gammapy v1.0
Gammapy is a community-developed, open-source Python package for gamma-ray astronomy built on Numpy, Scipy and Astropy. It is the core library for the...
Read more >
A Python package for gamma-ray astronomy - GitHub
Gammapy is an open-source Python package for gamma-ray astronomy built on Numpy, Scipy and Astropy. It is used as core library for the...
Read more >
Code — gamma-cat documentation
We list the modules in gammacat and comment on the code organisation. ... The SEDs in the output folder can be read directly...
Read more >
[1709.01751] Gammapy - A prototype for the CTA science tools
Gammapy is a Python package for high-level gamma-ray data analysis built on Numpy, Scipy and Astropy. It enables us to analyze gamma-ray data ......
Read more >
Gammapy - A prototype for the CTA science tools - arXiv Vanity
The Gammapy code base is structured into several sub-packages dedicated to ... be found via docs.gammapy.org by following the link to “tutorial notebooks”....
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