Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply black 24.1.0 #364

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test integral methods for cluster abundance."""

import time
import itertools

Expand Down
1 change: 1 addition & 0 deletions examples/cosmicshear/cosmicshear.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Define the likelihood factory function for the cosmic shear example.
"""

import os

import sacc
Expand Down
1 change: 1 addition & 0 deletions examples/cosmicshear/generate_cosmicshear_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Generate the cosmicshear.fits file.
"""

import numpy as np
import sacc
import pyccl as ccl
Expand Down
1 change: 1 addition & 0 deletions examples/des_y1_3x2pt/generate_des_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
http://desdr-server.ncsa.illinois.edu/despublic/y1a1_files/chains/2pt_NG_mcal_1110.fits

"""

from typing import Dict, Tuple
import fitsio
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions examples/srd_sn/generate_sn_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Generate SACC data into file srd-y1-converted.sacc.
"""

import os
import tarfile
import urllib.request
Expand Down
1 change: 1 addition & 0 deletions examples/srd_sn/sn_srd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Demonstration of the use of the :class:`Supernova` statistics object.
"""

import sacc
import firecrown.likelihood.gauss_family.statistic.supernova as sn
from firecrown.likelihood.gauss_family.gaussian import ConstGaussian
Expand Down
1 change: 0 additions & 1 deletion firecrown/connector/cobaya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@

"""


# flake8: noqa
1 change: 1 addition & 0 deletions firecrown/connector/cobaya/ccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Provide the class CCLConnector, which is an implementation of a Cobaya Theory.

"""

from __future__ import annotations
from typing import Optional, Dict, List, Union

Expand Down
1 change: 1 addition & 0 deletions firecrown/connector/cobaya/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This module provides the class :class:`LikelihoodConnector`, which is an implementation
of a Cobaya likelihood.
"""

from typing import List, Dict, Union

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion firecrown/connector/cosmosis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@

"""


# flake8: noqa
1 change: 1 addition & 0 deletions firecrown/connector/cosmosis/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
likelihood abstract base class; it the implementation of a CosmoSIS module,
not a specific likelihood.
"""

import cosmosis.datablock
from cosmosis.datablock import option_section
from cosmosis.datablock import names as section_names
Expand Down
1 change: 0 additions & 1 deletion firecrown/likelihood/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

"""


# flake8: noqa
1 change: 1 addition & 0 deletions firecrown/likelihood/gauss_family/statistic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package provides statistics objects to be used by Gaussian Family
likelihoods.
"""

# flake8: noqa
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The binned cluster number counts statistic predicts the number of galaxy
clusters within a single redshift and mass bin.
"""

from __future__ import annotations

from typing import List, Optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains the base class :class:`Source` for :class:`TwoPoint`
sources and implementations.
"""

# flake8: noqa
1 change: 1 addition & 0 deletions firecrown/modeling_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:class:`pyccl.Cosmology` class. This is used by likelihoods that need to access
reusable objects, such as perturbation theory or halo model calculators.
"""

from __future__ import annotations
from typing import Dict, Optional, Collection
from abc import ABC, abstractmethod
Expand Down
1 change: 0 additions & 1 deletion firecrown/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

"""


# flake8: noqa
1 change: 1 addition & 0 deletions firecrown/models/cluster/abundance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
and phenomenological predictions. This module contains the classes and
functions that produce those predictions.
"""

from typing import Dict, Tuple
import numpy as np
import numpy.typing as npt
Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/abundance_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""The module responsible for extracting cluster data from a sacc file.
"""

from typing import Tuple, List
import numpy as np
import numpy.typing as npt
Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/integrator/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module holds the classes that define the interface required to
integrate a function.
"""

from abc import ABC, abstractmethod
from typing import Callable, List, Tuple

Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/integrator/numcosmo_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This module holds the NumCosmo implementation of the integrator classes
"""

from enum import Enum
from typing import Callable, Optional, Tuple

Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/integrator/scipy_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This module holds the scipy implementation of the integrator classes
"""

from typing import Callable

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This module holds the classes that define the kernels that can be included
in the cluster abundance integrand."""

from enum import Enum
from typing import Tuple
import numpy.typing as npt
Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/mass_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module holds the classes that define the mass richness relations
that can be included in the cluster abundance integrand. These are
implementations of Kernels."""

from abc import abstractmethod
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/properties.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing classes relevant to defining cluster properties."""

from enum import Flag, auto


Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/recipes/cluster_recipe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for defining the ClusterRecipe class"""

from abc import ABC, abstractmethod
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/recipes/murata_binned_spec_z.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for defining the classes used in the MurataBinnedSpecZ cluster recipe."""

from typing import Callable, Optional, Tuple

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions firecrown/models/cluster/recipes/murata_unbinned_spec_z.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for defining the classes used in the MurataUnbinnedSpecZ cluster recipe."""

from typing import Callable, Optional

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion firecrown/updatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ def _get_derived_parameters(self) -> DerivedParameterCollection:


class UpdatableCollection(UserList[Any]):

"""UpdatableCollection is a list of Updatable objects and is itself
supports :meth:`update` and :meth:`reset` (although it does not inherit
from :class:`Updatable`).
Expand Down
1 change: 1 addition & 0 deletions tests/cluster_recipes/test_murata_binned_spec_z.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster abundance module."""

from unittest.mock import Mock

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/cluster_recipes/test_murata_unbinned_spec_z.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster abundance module."""

from unittest.mock import Mock

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/connector/cosmosis/test_cosmosis_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
As a unit test, what this can test is very limited.
This test do not invoke the `cosmosis` executable.
"""

from os.path import expandvars
import yaml
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/connector/test_mapping.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit testing for the mapping module.
"""

from typing import Any, Dict
import pytest
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for the module firecrown.likelihood.gauss_family.statistic.source.source.
"""

import pytest
import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the binned cluster number counts module."""

from unittest.mock import Mock
import sacc
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/gauss_family/statistic/test_statistic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for the module firecrown.likelihood.gauss_family.statistic.statistic.
"""

from typing import List
import numpy as np
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/gauss_family/statistic/test_supernova.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for the Supernova statistic.
"""

import pytest

import sacc
Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/gauss_family/statistic/test_two_point.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for the TwoPoint module.
"""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lk_derived_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Provides a trivial likelihood factory function for testing purposes.
The likelihood created provides one derived parameter named "derived_param0".
"""

from firecrown.likelihood.likelihood import NamedParameters
from . import lkmodule

Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lk_needing_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Provides a trivial likelihood factory function for testing purposes.
The likelihood created requires a string parameter named "sacc_file".
"""

from firecrown.likelihood.likelihood import NamedParameters
from . import lkmodule

Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lk_sampler_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The likelihood created requires a string parameter named "parameter_prefix"
and has a sampler parameter named "sampler_param0".
"""

from firecrown.likelihood.likelihood import NamedParameters
from . import lkmodule

Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lkmodule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Provides a trivial likelihood class and factory function for testing purposes.
"""

import sacc
from firecrown.parameters import DerivedParameterCollection, DerivedParameterScalar
from firecrown.likelihood.likelihood import Likelihood, NamedParameters
Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lkscript.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Provides a trivial likelihood factory function for testing purposes.
"""

from firecrown.modeling_tools import ModelingTools
from . import lkmodule

Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lkscript_invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
It should raise an exception because the factory function does not define
a build_likelihood Callable.
"""

from . import lkmodule


Expand Down
1 change: 0 additions & 1 deletion tests/likelihood/lkdir/lkscript_not_a_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
a build_likelihood as a Callable.
"""


build_likelihood = "I am not a function"
1 change: 1 addition & 0 deletions tests/likelihood/lkdir/lkscript_old.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Provides a trivial likelihood factory function for testing purposes.
"""

from . import lkmodule


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
It should raise an exception because the factory function does not return
a Likelihood object.
"""

from . import lkmodule


Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/test_cosmosis_likelihood.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the CosmoSIS likelihood module."""

from pytest import fixture
from cosmosis.datablock import DataBlock
import firecrown.connector.cosmosis.likelihood as like
Expand Down
1 change: 1 addition & 0 deletions tests/likelihood/test_likelihood.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for the module firecrown.likelihood.likelihood.
"""

import os
import sys
import pytest
Expand Down
1 change: 0 additions & 1 deletion tests/likelihood/test_named_parameters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for the class firecrown.likelihood.NamedParameters."""


import pytest
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions tests/test_cluster_abundance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster abundance module."""

import numpy as np
import pyccl
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_cluster_binning.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster binning module"""

from unittest.mock import Mock

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_cluster_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster abundance data module."""

import pytest
import sacc
from firecrown.models.cluster.abundance_data import AbundanceData
Expand Down
1 change: 1 addition & 0 deletions tests/test_cluster_kernels.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster kernel module."""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/test_cluster_mass_richness.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the cluster mass richness module."""

import pytest
import numpy as np
from scipy.integrate import quad
Expand Down
1 change: 1 addition & 0 deletions tests/test_descriptors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for the module firecrown.descriptors.
"""

import math
import pytest
from firecrown.descriptors import TypeFloat, TypeString
Expand Down
Loading
Loading