{"id":19505413,"url":"https://github.com/n3pdf/pdfflow","last_synced_at":"2025-04-26T02:31:56.220Z","repository":{"id":43133248,"uuid":"238731330","full_name":"N3PDF/pdfflow","owner":"N3PDF","description":"PDFflow is parton distribution function interpolation library written in Python and based on the TensorFlow framework. ","archived":false,"fork":false,"pushed_at":"2024-01-23T08:52:43.000Z","size":358,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T05:51:14.538Z","etag":null,"topics":["hep-ex","hep-ph","hep-th","parton-distribution-functions","pdf","pdf-interpolation","python","tensorflow"],"latest_commit_sha":null,"homepage":"https://pdfflow.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N3PDF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-06T16:19:43.000Z","updated_at":"2024-11-25T13:09:41.000Z","dependencies_parsed_at":"2024-11-10T22:31:58.718Z","dependency_job_id":"69aac892-cffa-44bf-8b0f-77058cb49a68","html_url":"https://github.com/N3PDF/pdfflow","commit_stats":{"total_commits":258,"total_committers":6,"mean_commits":43.0,"dds":0.5581395348837209,"last_synced_commit":"944fdca5e9c01720108b88a017f5b75f1c738847"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3PDF%2Fpdfflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3PDF%2Fpdfflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3PDF%2Fpdfflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3PDF%2Fpdfflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N3PDF","download_url":"https://codeload.github.com/N3PDF/pdfflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250922127,"owners_count":21508279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hep-ex","hep-ph","hep-th","parton-distribution-functions","pdf","pdf-interpolation","python","tensorflow"],"created_at":"2024-11-10T22:30:31.109Z","updated_at":"2025-04-26T02:31:55.911Z","avatar_url":"https://github.com/N3PDF.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/238731330.svg)](https://zenodo.org/badge/latestdoi/238731330)\n[![arxiv](https://img.shields.io/badge/arXiv-hep--ph%2F2009.06635-%23B31B1B.svg)](https://arxiv.org/abs/2009.06635)\n\n[![Documentation Status](https://readthedocs.org/projects/pdfflow/badge/?version=stable)](https://pdfflow.readthedocs.io/en/latest/?badge=stable)\n![pytest](https://github.com/N3PDF/pdfflow/workflows/pytest/badge.svg)\n[![AUR](https://img.shields.io/aur/version/python-pdfflow)](https://aur.archlinux.org/packages/python-pdfflow)\n\n# PDFFlow\n\nPDFFlow is parton distribution function interpolation library written in Python and based on the [TensorFlow](https://www.tensorflow.org/) framework. It is developed with a focus on speed and efficiency, enabling researchers to perform very expensive calculation as quick and easy as possible.\n\nThe key features of PDFFlow is the possibility to query PDF sets on GPU accelerators.\n\n## Documentation\n\nThe documentation for PDFFlow can be consulted in the readthedocs page: [pdfflow.readthedocs.io](https://pdfflow.readthedocs.io/en/latest).\n\n## Installation\n\nThe package can be installed with pip:\n\n```bash\npython3 -m pip install pdfflow[MODE]\n```\n\nIf you prefer a manual installation just `cd` in the cloned folder and use:\n\n```bash\npip install .[MODE]\n```\n\nor if you are planning to extend or develop code just install the package in\neditable mode:\n\n```bash\npip install -e .[MODE]\n```\n\n`PDFFlow` assumes that the user has already installed the most optimized version\nof TensorFlow for his platform. As such, by default, `pip` will not check it as\na requirement.\n\nHowever, the user can also install it specifying a `MODE` option in the\n`pip` command. The list below summarizes the valid choices for the `MODE` flag:\n\n- `tf`: installs the `tensorflow` package\n- `tf-cpu`: installs the `tensorflow-cpu` package\n- `tf-gpu`: installs the `tensorflow-gpu` package\n- `tf-amd`: installs the `tensorflow-rocm` package\n\n**⚠ Note: Use the latest version of TensorFlow!**\n\nTensorFlow is updated frequently and a later version of TensorFlow will often\noffer better performance in both GPUs and CPUs.\nAlthough it can be made to work with earlier versions, `PDFFlow` is only\nsupported for TensorFlow\u003e2.1.\n\n## PDF set management\n\nPDFFlow does not do management of PDF sets, which is left to LHAPDF and so a lhapdf installation is needed.\nA full lhapdf installation can be obtained by utilizing the `lhapdf_management` library.\n\n```bash\n  python3 -m pip install lhapdf_management\n  lhapdf_management install NNPDF31_nnlo_as_0118\n```\n\n## Minimal Working Example\n\nBelow a minimalistic example where `PDFFlow` is used to generate a 10 values of the PDF\nfor 2 members for three different flavours.\n\n```python\nfrom pdfflow import mkPDFs\nimport tensorflow as tf\n\npdf = mkPDFs(\"NNPDF31_nnlo_as_0118\", [0,2])\nx = tf.random.uniform([10], dtype=tf.float64)\nq2 = tf.random.uniform([10], dtype=tf.float64)*20 + 10\npid = tf.cast([-1,21,1], dtype=tf.int32)\n\nresult = pdf.xfxQ2(pid, x, q2)\n```\n\nNote the usage of the `dtype` keyword inm the TensorFlow calls.\nThis is used to ensure that `float64` is being used all across the program.\nFor convenience, we ship two functions, `int_me` and `float_me` which are simply\nwrappers to `tf.cast` with the right types.\n\nThese wrappers can be used over TensorFlow types but also numpy values:\n\n```python\nfrom pdfflow import mkPDFs, int_me, float_me\nimport tensorflow as tf\nimport numpy as np\n\npdf = mkPDFs(\"NNPDF31_nnlo_as_0118\", [0,2])\nx = float_me(np.random.rand(10))\nq2 = float_me(tf.random.uniform([10])*20 + 10)\npid = int_me([-1,21,1])\n\nresult = pdf.xfxQ2(pid, x, q2)\n```\n\n## Citation policy\n\nIf you use the package pelase cite the following paper and zenodo references:\n\n- https://doi.org/10.5281/zenodo.3964190\n- https://arxiv.org/abs/2009.06635\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3pdf%2Fpdfflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn3pdf%2Fpdfflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3pdf%2Fpdfflow/lists"}