From b8668693049c75ada4682f85f03916b8f7a04305 Mon Sep 17 00:00:00 2001 From: Ethan Marx <61295922+EthanMarx@users.noreply.github.com> Date: Tue, 14 May 2024 13:51:47 -0400 Subject: [PATCH] Merge `main` into `dev` (#128) * Adding funding statement * Add requirements to docs (#107) * add requirements to docs * remove myst_parser req * Update requirements.txt * Update conf.py * Update docs.yaml (#108) * Update docs.yaml * Update docs.yaml (#109) * simplify torch dependencies (#122) * simplify torch dependency * remove python constratints * fix pre-commit * Merge `dev` into `main` for 0.4.2 release (#123) * re-implement distributions using torch.distributions (#110) * loosely re-implement distributions using torch.distributions * further enhancement * rename * log_uniform as transformed dist * delete uniform and log_normal since they are already implemented * bring back LogNormal, change parameter sampler * add delta function distribution, minor fixes to other distributions * fix * Initial commit of q-transform * Added a MultiQTransform * Reparameterized to number of t and f bins * Re-factored SingleQTransform to allow for eventually using different q's for batch/channels * Changed interpolation to better match gwpy and added option to specify frequency range in which to search for max energy tile * Added QScan to __init__ * Changed from torch median to quantile to match numpy median * Added documentation to qtransform * Added gwpy to dev dependencies * Added tests and corrected get_freqs bug * Changed method of normalization and updated documentation * Updated more documentation and changed interpolation method * Changed how interpolation shape is parameterized * Reverted documentation to state expectation of 3D input * Fixed type hint for spectrogram_shape in qtransform * Switched tuple to Tuple * `InMemoryDataset` improvements (#119) * in memory dataset inherits from torch iterable dataset * pre-commit issues * fix yielding logic * fix in memory dataset tests * handle deprecated transpose ops in phenomd (#120) * Torch dependency fix into dev (#124) * udpate poetry lock * increment version once more * re add gwpy dev dep * update poetry lock * fix poetry conflic * fix poety conflict * Poetry fix (#126) * remove gwpy dep for now * poetry lock file --------- Co-authored-by: Deep Chatterjee Co-authored-by: wbenoit26 <90333821+wbenoit26@users.noreply.github.com> Co-authored-by: William Benoit Co-authored-by: William Benoit * increment version (#127) --------- Co-authored-by: wbenoit26 <90333821+wbenoit26@users.noreply.github.com> Co-authored-by: Deep Chatterjee Co-authored-by: William Benoit Co-authored-by: William Benoit --- .github/workflows/docs.yaml | 20 +++- README.md | 3 + docs/conf.py | 23 +---- docs/requirements.txt | 3 + poetry.lock | 183 +++++++++++++++++++++++++++++++++++- pyproject.toml | 3 +- 6 files changed, 206 insertions(+), 29 deletions(-) create mode 100644 docs/requirements.txt diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index cd60c4f9..2dab126f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -8,11 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - - name: Build docs - uses: ammaraskar/sphinx-action@master + - name: Setup python + id: setup-python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install Poetry + uses: snok/install-poetry@v1 with: - docs-folder: "docs/" + virtualenvs-create: false + virtualenvs-in-project: false + installer-parallel: true + - name: Install and Build Docs + run: | + poetry install + cd docs + make clean + make html - name: Deploy pages uses: JamesIves/github-pages-deploy-action@v4.2.5 diff --git a/README.md b/README.md index c2ebbe27..07903b63 100644 --- a/README.md +++ b/README.md @@ -130,3 +130,6 @@ We encourage users who encounter these difficulties to file issues on GitHub, an We also strongly encourage ML users in the GW physics space to try their hand at working on these issues and joining on as collaborators! For more information about how to get involved, feel free to reach out to [ml4gw@ligo.mit.edu](mailto:ml4gw@ligo.mit.edu) . By bringing in new users with new use cases, we hope to develop this library into a truly general-purpose tool which makes DL more accessible for gravitational wave physicists everywhere. + +## Funding +We are grateful for the support of the U.S. National Science Foundation (NSF) Harnessing the Data Revolution (HDR) Institute for Accelerating AI Algorithms for Data Driven Discovery (A3D3) under Cooperative Agreement No. PHY-2117997. diff --git a/docs/conf.py b/docs/conf.py index 3eb7e5c2..c6a7627a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,9 +10,10 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) +import os +import sys + +sys.path.insert(0, os.path.abspath("../")) # -- Project information ----------------------------------------------------- @@ -31,25 +32,9 @@ "sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_autodoc_typehints", - "myst_parser", "sphinx.ext.githubpages", ] -myst_enable_extensions = [ - "amsmath", - "colon_fence", - "deflist", - "dollarmath", - "fieldlist", - "html_admonition", - "html_image", - "linkify", - "replacements", - "smartquotes", - "strikethrough", - "substitution", - "tasklist", -] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..1b4a17af --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +sphinx-rtd-theme>=2.0.0 +sphinx-autodoc-typehints>=2.0.0 +docutils>=0.17 diff --git a/poetry.lock b/poetry.lock index 62c88653..b27edf60 100644 --- a/poetry.lock +++ b/poetry.lock @@ -811,6 +811,26 @@ files = [ {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, ] +[[package]] +name = "dqsegdb2" +version = "1.2.1" +description = "Simplified python interface to DQSEGDB" +optional = false +python-versions = ">=3.6" +files = [ + {file = "dqsegdb2-1.2.1-py3-none-any.whl", hash = "sha256:4a6eb2ad66bcd596f7eebd18229674b3ae262a54480c75ac135755b0a5e8f783"}, + {file = "dqsegdb2-1.2.1.tar.gz", hash = "sha256:6a222dbb7024de6de845ba5ad3583859cecf8ed5ce584ff5db6f01581b821f81"}, +] + +[package.dependencies] +igwn-auth-utils = ">=1.0.0" +ligo-segments = ">=1.0.0" + +[package.extras] +docs = ["sphinx", "sphinx-automodapi", "sphinx-rtd-theme"] +lint = ["flake8 (>=3.7.0)", "flake8-bandit"] +test = ["pytest (>=2.9.2)", "pytest-cov (>=2.5.1)", "requests-mock (>=1.5.0)"] + [[package]] name = "dynesty" version = "2.1.3" @@ -1009,6 +1029,76 @@ smb = ["smbprotocol"] ssh = ["paramiko"] tqdm = ["tqdm"] +[[package]] +name = "gwdatafind" +version = "1.2.0" +description = "The GWDataFind data discovery client" +optional = false +python-versions = ">=3.6" +files = [ + {file = "gwdatafind-1.2.0-py3-none-any.whl", hash = "sha256:58c505ee188c1186ff81b3de5f946f289179a4f8c334f7eb45d07dd70a71bd2c"}, + {file = "gwdatafind-1.2.0.tar.gz", hash = "sha256:8f74942e66cdb9a53030da29069110b3cb30afc2a034790957786028fb09f451"}, +] + +[package.dependencies] +igwn-auth-utils = ">=0.3.1" +ligo-segments = "*" + +[package.extras] +docs = ["numpydoc", "sphinx (>=4.4.0)", "sphinx-argparse", "sphinx-automodapi", "sphinx-rtd-theme"] +lint = ["flake8", "flake8-bandit", "flake8-docstrings", "radon"] +test = ["pytest (>=2.8.0)", "pytest-cov", "requests-mock"] + +[[package]] +name = "gwosc" +version = "0.7.1" +description = "A python interface to the GW Open Science data archive" +optional = false +python-versions = ">=3.5" +files = [ + {file = "gwosc-0.7.1-py3-none-any.whl", hash = "sha256:4cb7598f9aaf8749c032e8913c723a391784a52127397989c9f733f8c3f99558"}, + {file = "gwosc-0.7.1.tar.gz", hash = "sha256:5328223410081731ba4ef6f3be9f13ac4b3b9a43397fa04c1f50ddeb59895816"}, +] + +[package.dependencies] +requests = ">=1.0.0" + +[package.extras] +docs = ["sphinx", "sphinx-automodapi", "sphinx-rtd-theme"] +lint = ["flake8 (<5.0.0a0)", "flake8-bandit"] +test = ["pytest (>=2.7.0)", "pytest-cov", "pytest-socket", "requests-mock (>=1.5.0)"] + +[[package]] +name = "gwpy" +version = "2.1.5" +description = "A python package for gravitational-wave astrophysics" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gwpy-2.1.5-py2.py3-none-any.whl", hash = "sha256:544908c43ddcd1a8253424b3ad619d8a817c26f6be5cfce14503250716fb2733"}, + {file = "gwpy-2.1.5.tar.gz", hash = "sha256:687015973b84c0d628fa7b245ff8f6a2a7a6008aee6860f17167c87ee8394521"}, +] + +[package.dependencies] +astropy = ">=4.0" +dqsegdb2 = "*" +gwdatafind = ">=1.1.0" +gwosc = ">=0.5.3" +h5py = ">=2.8.0" +ligo-segments = ">=1.0.0" +ligotimegps = ">=1.2.1" +matplotlib = ">=3.3.0" +numpy = ">=1.16" +python-dateutil = "*" +scipy = ">=1.2.0" +tqdm = ">=4.10.0" + +[package.extras] +conda = ["python-framel (>=8.40.1)", "python-ldas-tools-framecpp", "python-nds2-client"] +dev = ["astropy (<5.1a0)", "ciecplib", "lalsuite", "lscsoft-glue", "maya", "pandas", "psycopg2", "pyRXP", "pycbc (>=1.13.4)", "pymysql", "python-ligo-lw (>=1.7.0)", "sqlalchemy", "uproot (>=3.11)", "uproot3"] +docs = ["numpydoc (>=0.8.0)", "requests", "sphinx (>=4.0.0)", "sphinx-automodapi", "sphinx-material (>=0.0.32)", "sphinx-panels (>=0.6.0)", "sphinxcontrib-programoutput"] +test = ["coverage[toml] (>=5.0)", "freezegun (>=0.3.12)", "pytest (>=3.9.1)", "pytest-cov (>=2.4.0)", "pytest-socket", "pytest-xdist", "requests-mock"] + [[package]] name = "h11" version = "0.14.0" @@ -1123,6 +1213,28 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] +[[package]] +name = "igwn-auth-utils" +version = "1.1.0" +description = "Authorisation utilities for IGWN" +optional = false +python-versions = ">=3.6" +files = [ + {file = "igwn-auth-utils-1.1.0.tar.gz", hash = "sha256:f993f0ed8b83538a14df7dda540eb2dcaebd26aa0b058fffa105cd6de2d16e69"}, + {file = "igwn_auth_utils-1.1.0-py3-none-any.whl", hash = "sha256:7ddd88292c8f952f096ed71b64ce3ca2054a24f442cfc0e3f3aef52a18a1460a"}, +] + +[package.dependencies] +cryptography = ">=2.3" +requests = ">=2.14" +safe-netrc = ">=1.0.0" +scitokens = ">=1.7.0" + +[package.extras] +docs = ["sphinx (>=4.0.0)", "sphinx-immaterial-igwn"] +lint = ["flake8 (>=3.7.0)", "flake8-bandit"] +test = ["pytest (>=3.9.1)", "pytest-cov", "requests-mock"] + [[package]] name = "imagesize" version = "1.4.1" @@ -1849,6 +1961,17 @@ files = [ [package.dependencies] six = "*" +[[package]] +name = "ligotimegps" +version = "2.0.1" +description = "A pure-python version of lal.LIGOTimeGPS" +optional = false +python-versions = ">=3.4" +files = [ + {file = "ligotimegps-2.0.1-py2.py3-none-any.whl", hash = "sha256:da8c1289ba1310337ef5177e7936e25ce47d4e8e6a269cbdd5e9abfc5b5db490"}, + {file = "ligotimegps-2.0.1.tar.gz", hash = "sha256:88626c02ad9a464d1242a1147b40074792f424bafa2ab013eee629c7d1b6469c"}, +] + [[package]] name = "lscsoft-glue" version = "4.0.0" @@ -2549,8 +2672,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.20.3", markers = "python_version < \"3.10\""}, - {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, {version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, + {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" @@ -2938,6 +3061,23 @@ files = [ [package.extras] windows-terminal = ["colorama (>=0.4.6)"] +[[package]] +name = "pyjwt" +version = "2.8.0" +description = "JSON Web Token implementation in Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "PyJWT-2.8.0-py3-none-any.whl", hash = "sha256:59127c392cc44c2da5bb3192169a91f429924e17aff6534d70fdc02ab3e04320"}, + {file = "PyJWT-2.8.0.tar.gz", hash = "sha256:57e28d156e3d5c10088e0c68abb90bfac3df82b40a71bd0daa20c65ccd5c23de"}, +] + +[package.extras] +crypto = ["cryptography (>=3.4.0)"] +dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pytest (>=6.0.0,<7.0.0)", "sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] + [[package]] name = "pyopenssl" version = "24.1.0" @@ -3437,6 +3577,20 @@ files = [ {file = "rpds_py-0.18.1.tar.gz", hash = "sha256:dc48b479d540770c811fbd1eb9ba2bb66951863e448efec2e2c102625328e92f"}, ] +[[package]] +name = "safe-netrc" +version = "1.0.1" +description = "Safe netrc file parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "safe-netrc-1.0.1.tar.gz", hash = "sha256:1dcc7263b4d9ce72e0109d8e2bc9ba89c8056ccc618d26c8c94802c6fd753720"}, + {file = "safe_netrc-1.0.1-py3-none-any.whl", hash = "sha256:5f0dd6a5e304b1da3be220f15efedbf09e50779fe90462143c228c781b9d8218"}, +] + +[package.extras] +test = ["pytest"] + [[package]] name = "scipy" version = "1.10.1" @@ -3475,6 +3629,25 @@ dev = ["click", "doit (>=0.36.0)", "flake8", "mypy", "pycodestyle", "pydevtool", doc = ["matplotlib (>2)", "numpydoc", "pydata-sphinx-theme (==0.9.0)", "sphinx (!=4.1.0)", "sphinx-design (>=0.2.0)"] test = ["asv", "gmpy2", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +[[package]] +name = "scitokens" +version = "1.8.1" +description = "SciToken reference implementation library" +optional = false +python-versions = ">=3.5" +files = [ + {file = "scitokens-1.8.1-py3-none-any.whl", hash = "sha256:a5455d85969cd7c7b341ed8691ea89e0e446bd414a734f8443752081b049b46c"}, + {file = "scitokens-1.8.1.tar.gz", hash = "sha256:f255383d9c7402b3fcd20d5ed26a6b407b4be8bec6f282d0af29b6275382b54d"}, +] + +[package.dependencies] +cryptography = "*" +PyJWT = ">=1.6.1" +requests = "*" + +[package.extras] +docs = ["Sphinx"] + [[package]] name = "send2trash" version = "1.8.3" @@ -4087,13 +4260,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.26.1" +version = "20.26.2" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.26.1-py3-none-any.whl", hash = "sha256:7aa9982a728ae5892558bff6a2839c00b9ed145523ece2274fad6f414690ae75"}, - {file = "virtualenv-20.26.1.tar.gz", hash = "sha256:604bfdceaeece392802e6ae48e69cec49168b9c5f4a44e483963f9242eb0e78b"}, + {file = "virtualenv-20.26.2-py3-none-any.whl", hash = "sha256:a624db5e94f01ad993d476b9ee5346fdf7b9de43ccaee0e0197012dc838a0e9b"}, + {file = "virtualenv-20.26.2.tar.gz", hash = "sha256:82bf0f4eebbb78d36ddaee0283d43fe5736b53880b8a8cdcd37390a07ac3741c"}, ] [package.dependencies] @@ -4187,4 +4360,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8,<3.12" -content-hash = "66448ca3e2abf31b3af573fa4fae9f54c42a4046d6bcbc07090cafcd32ae0180" +content-hash = "edcd434ba5ed546474ad7d931bbd964680f0baa8241f33e2dffe074a364a501b" diff --git a/pyproject.toml b/pyproject.toml index 3c6c7874..61d6eb73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ml4gw" -version = "0.4.1" +version = "0.4.2" description = "Tools for training torch models on gravitational wave data" readme = "README.md" authors = [ @@ -23,6 +23,7 @@ pytest = "^7.0" lalsuite = "^7.0" bilby = "^2.1" jupyter = "^1.0.0" +gwpy = "^2.1" Sphinx = ">5.0" sphinx-rtd-theme = "^2.0.0"