Skip to content

Commit 774dd27

Browse files
author
Arya Farahi
committed
Initial commit
0 parents  commit 774dd27

8 files changed

+4065
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Arya Farahi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

data/TNG300_Halos.csv

+2,001
Large diffs are not rendered by default.

example.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from kllr import *
2+
import numpy as np
3+
import matplotlib.pyplot as plt
4+
import pandas as pd
5+
import sys
6+
7+
print(sys.path)
8+
9+
df = pd.read_csv('./data/TNG300_Halos.csv')
10+
print(df.columns)
11+
x = np.array(df.M200)
12+
y = np.array(df.MGas)
13+
14+
15+
16+
# data, ax = Plot_Fit(df, 'M200', 'MGas', show_data=True, cutoff=13.5, ax=None) ## PASSED
17+
# data, ax = Plot_Fit_Split(df, 'M200', 'MGas', 'z_form', split_bins = [0.0, 0.2, 0.3, 0.6]) ## PASSED
18+
# data, ax = Plot_Fit_Params(df, 'M200', 'MGas') ## PASSED
19+
# data, ax = Plot_Fit_Params_Split(df, 'M200', 'MGas', 'z_form', split_bins = [0.0, 0.2, 0.3, 0.6])
20+
# data, ax = Plot_Correlation(df, 'M200', 'MGas', 'MStar') ## PASSED
21+
# data, ax = Plot_Correlation_Split(df, 'M200', 'MGas', 'MStar', 'z_form', split_bins = [0.0, 0.2, 0.3, 0.6]) ##PASSED
22+
# data, ax = Plot_Covariance(df, 'M200', 'MGas', 'MStar', GaussianWidth=0.2)
23+
# data, ax = Plot_Covariance_Split(df, 'M200', 'MGas', 'MStar', 'z_form', split_bins = [0.0, 0.2, 0.3, 0.6]) ## PASSED
24+
# ax = Plot_Correlation_Matrix(df, 'M200', ['MGas', 'MGas_T', 'sigma_DM_3D']) ## PASSED
25+
# ax = Plot_Correlation_Matrix_Split(df, 'M200', ['MGas', 'MGas_T', 'sigma_DM_3D'], 'z_form', split_bins=[0.0, 0.2, 0.3, 0.6]) ## PASSED
26+
# ax = Plot_Covariance_Matrix(df, 'M200', ['MGas', 'MStar', 'sigma_DM_3D']) ## PASSED
27+
# ax = Plot_Covariance_Matrix_Split(df, 'M200', ['MGas', 'MStar', 'MStar_BCG100'], 'z_form', split_bins=[0.0, 0.2, 0.3, 0.6]) ## PASSED
28+
# data, ax = Plot_Residual(df, 'M200', 'MGas') ## PASSED
29+
data, ax = Plot_Residual_Split(df, 'M200', 'MGas', 'z_form', split_bins = [0.0, 0.2, 0.3, 0.6])
30+
31+
plt.show()

kllr/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .regression_model import kllr_model
2+
from .regression_plotting import Plot_Fit, Plot_Fit_Split, Plot_Fit_Params, Plot_Fit_Params_Split,\
3+
Plot_Correlation, Plot_Correlation_Split, Plot_Covariance, Plot_Covariance_Split,\
4+
Plot_Correlation_Matrix, Plot_Correlation_Matrix_Split, Plot_Covariance_Matrix,\
5+
Plot_Covariance_Matrix_Split, Plot_Residual, Plot_Residual_Split

0 commit comments

Comments
 (0)