Skip to content

Commit

Permalink
fix for import sorts
Browse files Browse the repository at this point in the history
  • Loading branch information
santiagocasas committed Nov 23, 2023
1 parent d7a601a commit fffd760
Show file tree
Hide file tree
Showing 21 changed files with 122 additions and 80 deletions.
10 changes: 6 additions & 4 deletions cosmicfishpie/CMBsurvey/CMB_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
This is the main engine for CMB Fisher Matrix.
"""
import copy
import datetime
import os
import numpy as np
from itertools import product
from time import time

import numpy as np
import pandas as pd
import copy
import datetime
import cosmicfishpie.fishermatrix.derivatives as fishderiv

import cosmicfishpie.CMBsurvey.CMB_obs as CMB_obs
import cosmicfishpie.fishermatrix.config as cfg
import cosmicfishpie.fishermatrix.derivatives as fishderiv
from cosmicfishpie.utilities.utils import printing as upt

pd.set_option('display.float_format', '{:.9E}'.format)
Expand Down
11 changes: 7 additions & 4 deletions cosmicfishpie/CMBsurvey/CMB_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
This module contains cls calculations (only LSS atm).
"""
from cosmicfishpie.utilities.utils import printing as upt
from itertools import product
from time import time
import cosmicfishpie.fishermatrix.config as cfg
import cosmicfishpie.cosmology.cosmology as cosmology

import numpy as np
from itertools import product
from joblib import Memory

import cosmicfishpie.cosmology.cosmology as cosmology
import cosmicfishpie.fishermatrix.config as cfg
from cosmicfishpie.utilities.utils import printing as upt

cachedir = './cache'
memory = Memory(cachedir, verbose=0)

Expand Down
10 changes: 6 additions & 4 deletions cosmicfishpie/LSSsurvey/photo_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
This is the main engine for LSS Fisher Matrix.
"""
import numpy as np
import copy
import datetime
from itertools import product
from time import time

import numpy as np
import pandas as pd
import copy
import datetime

import cosmicfishpie.fishermatrix.config as cfg
import cosmicfishpie.fishermatrix.derivatives as fishderiv
import cosmicfishpie.LSSsurvey.photo_obs as photo_obs
import cosmicfishpie.fishermatrix.config as cfg
from cosmicfishpie.utilities.utils import printing as upt

pd.set_option('display.float_format', '{:.9E}'.format)
Expand Down
17 changes: 10 additions & 7 deletions cosmicfishpie/LSSsurvey/photo_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
This module contains cls calculations (only LSS atm).
"""
from cosmicfishpie.utilities.utils import printing as upt
from itertools import product
from time import time
import cosmicfishpie.fishermatrix.config as cfg
import cosmicfishpie.LSSsurvey.photo_window as photo_window
import cosmicfishpie.cosmology.nuisance as nuisance
import cosmicfishpie.cosmology.cosmology as cosmology

import numpy as np
from joblib import Memory
from scipy import integrate
from scipy.interpolate import interp1d
from itertools import product
from joblib import Memory

import cosmicfishpie.cosmology.cosmology as cosmology
import cosmicfishpie.cosmology.nuisance as nuisance
import cosmicfishpie.fishermatrix.config as cfg
import cosmicfishpie.LSSsurvey.photo_window as photo_window
from cosmicfishpie.utilities.utils import printing as upt

cachedir = './cache'
memory = Memory(cachedir, verbose=0)

Expand Down
1 change: 1 addition & 0 deletions cosmicfishpie/LSSsurvey/photo_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import numpy as np
from scipy.integrate import trapz
from scipy.special import erf

import cosmicfishpie.fishermatrix.config as cfg


Expand Down
6 changes: 4 additions & 2 deletions cosmicfishpie/LSSsurvey/spectro_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
This module contains cls calculations (only LSS atm).
"""
import copy
from time import time

import numpy as np

import cosmicfishpie.fishermatrix.config as cfg
import cosmicfishpie.LSSsurvey.spectro_obs as spec_obs
from cosmicfishpie.fishermatrix.derivatives import derivatives
from time import time
from cosmicfishpie.utilities.utils import printing as upt
import copy


class SpectroCov:
Expand Down
8 changes: 4 additions & 4 deletions cosmicfishpie/LSSsurvey/spectro_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
This module contains cls calculations (only LSS atm).
"""
import numpy as np

from copy import deepcopy
from time import time

import numpy as np
from scipy.interpolate import CubicSpline

import cosmicfishpie.cosmology.cosmology as cosmology
import cosmicfishpie.cosmology.nuisance as nuisance
import cosmicfishpie.fishermatrix.config as cfg
from scipy.interpolate import CubicSpline
from time import time
from cosmicfishpie.utilities.utils import numerics as unu
from cosmicfishpie.utilities.utils import printing as upt

Expand Down
1 change: 1 addition & 0 deletions cosmicfishpie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
from .version import VERSION, VERSION_SHORT

__all__ = [] # list submodules


Expand Down
4 changes: 3 additions & 1 deletion cosmicfishpie/analysis/fisher_derived.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@

# ***************************************************************************************

import os
import copy
import os

import numpy as np

from . import fisher_matrix as fm

# ***************************************************************************************
Expand Down
6 changes: 4 additions & 2 deletions cosmicfishpie/analysis/fisher_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@

# ***************************************************************************************

import os
import copy
import os
from pathlib import Path

import numpy as np

from . import utilities as fu
from pathlib import Path

# ***************************************************************************************

Expand Down
4 changes: 3 additions & 1 deletion cosmicfishpie/analysis/fisher_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@

# ***************************************************************************************

import math

import numpy as np

from . import fisher_matrix as fm
import math

# ***************************************************************************************

Expand Down
14 changes: 8 additions & 6 deletions cosmicfishpie/analysis/fisher_plot_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
"""

import copy
import math

# ***************************************************************************************
import os
import math
import copy

import numpy as np
from . import utilities as fu
from . import fisher_matrix as fm
from . import fisher_derived as fd
from . import fisher_operations as fo

from . import __init__ as CosmicFishPyLib
from . import fisher_derived as fd
from . import fisher_matrix as fm
from . import fisher_operations as fo
from . import utilities as fu

# ***************************************************************************************

Expand Down
12 changes: 6 additions & 6 deletions cosmicfishpie/analysis/fisher_plotting.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import os
import matplotlib.pyplot as plt

import matplotlib
import matplotlib.pyplot as plt
from getdist import plots
from getdist.gaussian_mixtures import GaussianND

from cosmicfishpie.utilities.utils import filesystem as ffs

from . import fisher_matrix as fm
from . import fisher_plot_analysis as fpa
from . import plot_comparison as pc

from cosmicfishpie.utilities.utils import filesystem as ffs

from getdist import plots
from getdist.gaussian_mixtures import GaussianND

matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams.update({'font.family': 'cm'})
params = {'mathtext.fontset': 'cm',
Expand Down
18 changes: 11 additions & 7 deletions cosmicfishpie/analysis/plot_comparison.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@

# Code for comparison of Fisher Matrix entries
# Taken from original plfmat.py code by Dida Markovic and Santiago Casas
import seaborn as sns
from . import fisher_operations as fo
from . import utilities as fu
import os
import numpy as np
from mpl_toolkits import axes_grid1
import matplotlib.patches as mpatches
import matplotlib.ticker as ticker

import matplotlib
import matplotlib.patches as mpatches

# matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import seaborn as sns
from mpl_toolkits import axes_grid1

from . import fisher_operations as fo
from . import utilities as fu

plt.style.use('tableau-colorblind10')


Expand Down
6 changes: 4 additions & 2 deletions cosmicfishpie/analysis/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

# ***************************************************************************************

import itertools as it
import math
import os

import numpy as np
import itertools as it
from scipy.stats.distributions import chi2
import os

# ***************************************************************************************


Expand Down
24 changes: 15 additions & 9 deletions cosmicfishpie/cosmology/cosmology.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@

import os
import sys
import numpy as np
import types
import cosmicfishpie.fishermatrix.config as cfg
from glob import glob
from copy import deepcopy
from scipy.interpolate import UnivariateSpline, RectBivariateSpline, InterpolatedUnivariateSpline
from scipy.signal import savgol_filter
from glob import glob
from time import time
from warnings import warn

import numpy as np
import scipy.constants as sconst
from joblib import Memory
from scipy import integrate
from scipy.interpolate import (
InterpolatedUnivariateSpline,
RectBivariateSpline,
UnivariateSpline,
)
from scipy.signal import savgol_filter

import cosmicfishpie.fishermatrix.config as cfg
from cosmicfishpie.utilities.utils import numerics as unu
from cosmicfishpie.utilities.utils import printing as upr
from warnings import warn
import scipy.constants as sconst
from time import time

from joblib import Memory
cachedir = 'memory_cache'
memory = Memory(cachedir, verbose=0)

Expand Down
5 changes: 3 additions & 2 deletions cosmicfishpie/cosmology/nuisance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"""

import os

import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline, UnivariateSpline, interp1d

import cosmicfishpie.fishermatrix.config as cfg
from cosmicfishpie.utilities.utils import numerics as unu
from scipy.interpolate import interp1d, UnivariateSpline, InterpolatedUnivariateSpline
from cosmicfishpie.utilities.utils import printing as upr



class Nuisance:

def __init__(self):
Expand Down
12 changes: 7 additions & 5 deletions cosmicfishpie/fishermatrix/config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# This class defines global variables that will not change through
# the computation of one fisher matrix

import numpy as np
import os
import glob
import yaml
import os
from copy import deepcopy
from cosmicfishpie.cosmology.nuisance import Nuisance
from time import time

import numpy as np
import yaml

import cosmicfishpie.cosmology.cosmology as cosmology
from cosmicfishpie.cosmology.nuisance import Nuisance
from cosmicfishpie.utilities.utils import printing as upt
from time import time


def init(options=dict(),
Expand Down
23 changes: 13 additions & 10 deletions cosmicfishpie/fishermatrix/cosmicfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@
"""
import os
import sys
from time import time
from copy import deepcopy
import pandas as pd
from itertools import product
from time import time

import numpy as np
import pandas as pd
from scipy.integrate import simps
from itertools import product
import cosmicfishpie.LSSsurvey.photo_obs as photo_obs
import cosmicfishpie.LSSsurvey.photo_cov as photo_cov
import cosmicfishpie.LSSsurvey.spectro_obs as spec_obs
import cosmicfishpie.LSSsurvey.spectro_cov as spec_cov

import cosmicfishpie.CMBsurvey.CMB_cov as CMB_cov
import cosmicfishpie.fishermatrix.config as cfg
from cosmicfishpie.utilities.utils import numerics as unu
import cosmicfishpie.LSSsurvey.photo_cov as photo_cov
import cosmicfishpie.LSSsurvey.photo_obs as photo_obs
import cosmicfishpie.LSSsurvey.spectro_cov as spec_cov
import cosmicfishpie.LSSsurvey.spectro_obs as spec_obs
from cosmicfishpie.analysis import fisher_matrix as fm

#from cosmicfishpie.cosmology.cosmology import *
from cosmicfishpie.utilities.utils import printing as upt
from cosmicfishpie.utilities.utils import filesystem as ufs
from cosmicfishpie.analysis import fisher_matrix as fm
from cosmicfishpie.utilities.utils import numerics as unu
from cosmicfishpie.utilities.utils import printing as upt


def ray_session(num_cpus=4, restart=True, shutdown=False):
Expand Down
Loading

0 comments on commit fffd760

Please sign in to comment.