Giter Site home page Giter Site logo

compwa.github.io's People

Contributors

dependabot[bot] avatar pre-commit-ci[bot] avatar redeboer avatar shenvitor avatar zeyna777 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compwa.github.io's Issues

Concatenate 4-momentum objects from `vector` package

I did not find a way to do Concatenation in 4-momentum objects from vector package directly

Here is the temporary solution:

  • Convert to tuple of numpy

  • Concatenate via numpy for the tuple of numpy

  • Convert back to tuple of vector objects

Just for the record.
Maybe we will be finding a better solution soon(?)

Freeze notebooks

Currently, all notebooks are run every commit in order to generate output cells on the web pages. This has a few major disadvantages:

  • ADRs and TRs are written for specific package versions: they are meant to illustrate a certain problem at a moment in time during development.
  • CI will take longer the more notebooks are added.

Instead, we could/should:

  • store cell output in the notebooks. Disadvantage is that the notebooks become larger and diffs are harder to read. But in principle, notebooks should not change once they have been committed to the master branch.
  • only run CI on notebooks that are affected by a certain PR and check whether they run correctly.
  • provide a means of freezing the dependencies for each notebook (probably just a Jupyter magic cell !pip install ...).

Speed up Binder builds

It currently takes a very long time to build a Binder image when launching a notebook. This load time might be reduced if installing only the doc requirements instead of all dev requirements.

Investigate difference between unbinned fit with PDFs versus normalization in the estimator

ComPWA (C++) and TensorWaves do their unbinned negative log likelihood fit with pure functions as opposed to working with Probability Density Functions (PDFs). The normalization in each fit step therefore takes place in the estimator and not in the function. Fit fractions are then computed by integrating at the end, not by reading off coefficients.

Some questions to answer:

  • Does this approach result in the same observables, like fit fractions (in our experience: yes)?
  • Is there a performance win or loss?

Plotly plots of Riemann sheets are not showing on ComPWA webpage

The 3D interactive plots of the Riemann sheets made using plotly are not being displayed on RTD, even though they are shown in Jupyter Lab.

Tasks

  1. 8 of 8
    🔨 Maintenance 🖱️ DX
    redeboer
  2. 3 of 3
    📝 Docs 🖱️ DX
    redeboer

Embed Zenodo metadata in repositories

The metadata of Zenodo DOIs currently need to be edited by hand after a release, because (for instance) Zenodo does not extract the package description from README.md.

  • One improvement would be to embed a .zenodo.json file. For an example, see here (requires ComPWA membership), and then tab "Metadata".
    ComPWA/qrules#112
    ComPWA/ampform#165
    ComPWA/tensorwaves#329
  • It needs to be checked whether certain meta-data like "version" can be left out. Zenodo already guesses this correctly from Git, so it does not make sense to also embed the version in .zenodo.json.
    --> Works ✔️ https://zenodo.org/record/5561166
  • Additionally, a check could be added to the check-dev-files pre-commit hook so that the .zenodo.json content stays up to date with the rest of the package.

Insert form factors in TR-013 (spin alignment)

TR-013 by #111 differs from 10.1155/2020/6674595 in two ways:

  • It uses Breit-Wigners without form factors. Since ComPWA/ampform#251 however, it's possible to generate 'helicity-like coefficient names' for an amplitude model generated with formalism="canonical-helicity". This makes it possible to generate all LS-combinations and generate the coefficients from Table 1.
  • It uses coefficients for the amplitude of the each decay chain, not helicity couplings. See ComPWA/ampform#254. Note that the difficulty here lies in correctly correlating the helicity couplings as described in Appendix D.

Add page about symbolic computations

Outline

Should essentially be a non-academic summary of also https://github.com/ComPWA/RUB-EP1-AG/issues/61

Proofread

Write Technical Report on recursive kinematic variable expressions with SymPy

Currently, kinematic variables like helicity angles are computed in AmpForm with NumPy only. This is clumsy, because AmpForm should ideally only produce mathematical expressions. The only reason why this NumPy implementation is in AmpForm is that TensorWaves (which implements the back-ends) is kept as 'ignorant' about physics as possible.

The difficulty with expression kinematic variable computation with SymPy lies in the fact that we require Einstein summation, see e.g. implementation here:
https://github.com/ComPWA/ampform/blob/f38179483ac20664584014d9eb659866966681c2/src/ampform/data.py#L209-L213

This is difficult to be done with SymPy in such a way that the lambdified expression has the same form (at least when using NumPy as a back-end). Some implementation attempts were made in (local) branches for the AmpForm repo. These should be documented in a TR. They can also be extended with a similar solution presented in ComPWA/ampform#115 (which allows defining custom lambdification methods for certain nodes in the expression tree).

Additional notes

Finalize develop page

As the ComPWA repositories are developed for an academic environment, they are expected to evolve continuously. We therefore need to focus more on the developer than the user (one wonders whether there should be a distinction).

In an interactive set-up like that that, a more extensive contribute page would be a valuable resource, not only to standardise contribute conventions (it's current purpose), but also to have an inventory of what developer tools are out there and how to use them (didactic purpose).

Some examples:

  • Working with Git and GitHub
  • Writing/running unit tests
  • Python developer tools (e.g. linting and formatters)
  • Sphinx and reStructuredText syntax
  • Continuous integration and local automatisation (e.g. pre-commit)

Of course, we don't need to write tutorials that are already out there: bundling the essentials and referring to helpful resources is already an improvement.

See also:

To-do list:

  • How to build documentation (reST and sphinx)
  • Creating a pull request
  • Note about linear commit history and squashing
  • pylint, flake8, black, mypy, and how our coding conventions are automatically enforced through their configs (ComPWA/tensorwaves#48 (comment))
  • Explain how to install nbextension --> not necessary since Jupyter Lab v3.x
  • Note about how linear commits serve as version patches
  • How to checkout a PR or a branch from another remote

`jaxlib`: could not find a version that satisfies

Bug description

the line

%pip install -q ampform==0.14.0 qrules==0.9.7 sympy==1.10.1 tensorwaves[jax,pwa]==0.4.5

causes the error

Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement jaxlib; extra == "jax" (from tensorwaves[jax,pwa]) (from versions: none)
ERROR: No matching distribution found for jaxlib; extra == "jax"

once I remove jax from the tensorwaves options, it works.

System info

I am on the e73542d commit of polarization-sensitivity branch running the notebook 017.ipynb

Bug resulted on the following system:

  • OS: Windows 10
  • Python version: 3.8.13
  • Virtual environment: conda env create from the project folder

Formulate ComPWA organization ideals

Developer experience:

  • Open source development for Partial Wave Analysis. Make it easy for anyone to contribute.
  • Easy to setup for developers
  • Code modularity and transparency. For example separation of the expertsystem and tensorwaves. First takes incorporates the physics and builds an amplitude model. Tensorwaves can use amplitude models and perform fits, but does not include any physics logic.
  • Facilitate using industry techniques and tools in software development for PWA
  • Accommodate both stable development and flexibility for ongoing analyses

User experience:

  • Easy to install and use for analysis users

Note: ComPWA rather sacrifices functionality for design and developer experience related developments. The flexible branching model aims to make up for the functionality loss.

Support Technical Report notebooks with Julia kernels

Would be nice to be able to experiment with Julia in the Technical Reports, so that the project is not necessarily tied to Python.

Some requirements:

  • easy to set up the kernel (through Conda?)
  • easy to open the notebook with this kernel in VSCode and Jupyter Lab
  • code snippets should render correctly in static HTML pages
  • possible to run the notebook during the Sphinx build with myst-nb
  • (?) support Pluto notebooks

🎉 See result in TR-019.

Use `scipy.integrate.quad_vec()` in symbolic integral lambdification

TR-016 investigates how to implement the lambdification for a symbolic integral over vectorized, complex-valued input. It did not yet investigate the use of scipy.integrate.quad_vec(), which seems to work well with lambdas that take array intances from outside and can therefore be put inside generated lambdify code.

Also note the version of quadpy that is currently pinned in TR-016 is not available anymore (something with licences). It may therefore be worth entirely rewriting the report so that it only uses scipy.

Pin all dependencies in the technical reports

Currently, TRs have a pip install statement where the packages that are required for the notebook itself. The packages are pinned to a specific version in an attempt to make the notebook reproducible, but indirect dependencies are not pinned. This results in bugs like #272.

Unfortunately, Jupyter notebooks do not support launching sub-kernels. That would be the ideal solution: you have a main developer environment for the repository that you can for instance use to start Jupyter Lab, and then each notebook launches a subkernel with it's own specific set of dependencies.

The closest we can get to an isolated kernel is by doing a pip install with --prefix and then using sys.path.insert to import from that directory. You can create a constraint file for all indirect dependencies with pip compile (or faster: uv pip compile). Providing a constraint file for each notebook then makes each technical report reproducible.

Disadvantages:

  • The notebook cannot be run on its own: you need the constraint file. That works fine on Binder, but Google Colab (and Deepnote?) only have access to the notebook, not the whole repo.
  • You need to pip compile the constraint files. Is that done through the notebook as well? How to provide a mechanism where the writer of the report can specify which direct dependencies are required and then compile a constraint file from that?
  • ...

Remove `sphinx-needs` plugin

Tasks

Original post

The problem seems to be caused by sphinx-needs, which we use to structure and interlink the technical reports (e.g. the table at compwa-org.rtfd.io/reports.html). Once the sphinx_needs extension has been disabled (564e827), Plotly figures are visible again (removing any need or spec directives from the notebook also does not fix the problem).

An alternative for organizing report notebooks may be sphinx-gallery, but this does not seem to work well with MyST-NB. Ideally, we want to have something like learn.astropy.org, where you can search for notebooks with filters etc.

Some alternatives:

Dependency issue

What happened?

TR-000 run in Colab is not successful due to the following issues.

Relevant log output

Screenshot 2024-05-06 at 15 33 09

Is it possible to reproduce the bug with a small code snippet?

See above

Additional steps to reproduce the bug

No

Which Python version were you using?

None

Python dependencies

No response

Migrate organization websites

The pages for this repository are currently hosted on RTD. Its URL is a bit ugly though (compwa-org.rtfd.io), especially since the original ComPWA C++ project has been archived and ComPWA is to be considered an organization anyway.

Since the pages for compwa-org on RTD are not versioned, we could host them on GitHub Pages, particularly on the namespace for the ComPWA GitHub organization (compwa.github.io). That URL currently hosts pycompwa's documentation, but that could be moved to compwa.github.io/pycompwa. The only thing that's lost is the ability to have PR previews, but that could be kept by just letting compwa-org.rtfd.io redirect to compwa.github.io (see RTD redirects).

ComPWA ++ / pycompwa

Organization page redirects

  1. 📝 Docs
    redeboer

Provide specific developer instructions for this repository

This repository has some peculiarities that not explained by the general develop page. Some things that need explaining (potentially on the general page as well):

  • What does environment.yml do, and where does it fetch (optional) pip dependencies and constraints
  • What is the first notebook cell in each notebook
  • Why are the pip install package==0.x.x statements needed
  • How best to work with cell metadata
  • How to 'freeze' cell output once a report is finished
  • How to store embed images in the notebooks without committing them to the repository (see this tip).
  • How to create GIF animations (see #129 (comment))
  • ...

Improve and freeze P-vector reports

Some left-overs from the todo-list of #278.

To do

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.