Skip to content

Commit

Permalink
Merge pull request #106 from LSSTDESC/cmbant-minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes from Antony
  • Loading branch information
joezuntz authored Jul 19, 2024
2 parents 23c0cd4 + 030160f commit 5d000b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sacc/sacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ def add_ell_cl(self, data_type, tracer1, tracer2, ell, x,
raise ValueError("Input bandpowers are misshapen")
tag_extra = range(window.nv)
tag_extra_name = "window_ind"
window_use = [window for i in range(window.nv)]
window_use = [window for _ in range(window.nv)]
else:
tag_extra = None
tag_extra_name = None
Expand Down
14 changes: 7 additions & 7 deletions sacc/tracers.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ def from_tables(cls, table_list):
for table in table_list:
# Read name and table type
name = table.meta['SACCNAME']
quantity = table.meta.get('SACCQTTY', 'generic')
tabtyp = table.meta['EXTNAME'].split(':')[-1]
if tabtyp not in ['beam']:
raise KeyError("Unknown table type " + table.meta['EXTNAME'])
Expand All @@ -317,7 +316,7 @@ def from_tables(cls, table_list):
tr_tables[name][tabtyp] = table

# Now loop through different tracers and build them from their tables
for n, dt in tr_tables.items():
for dt in tr_tables.values():
quantity = []
metadata = {}
map_unit = 'none'
Expand Down Expand Up @@ -452,7 +451,6 @@ def from_tables(cls, table_list):
for table in table_list:
# Read name and table type
name = table.meta['SACCNAME']
quantity = table.meta.get('SACCQTTY', 'generic')
tabtyp = table.meta['EXTNAME'].split(':')[-1]
if tabtyp not in ['bandpass', 'beam']:
raise KeyError("Unknown table type " + table.meta['EXTNAME'])
Expand All @@ -464,7 +462,7 @@ def from_tables(cls, table_list):
tr_tables[name][tabtyp] = table

# Now loop through different tracers and build them from their tables
for n, dt in tr_tables.items():
for dt in tr_tables.values():
quantity = []
metadata = {}
nu = []
Expand Down Expand Up @@ -652,10 +650,12 @@ def from_tables(cls, table_list):

class QPNZTracer(BaseTracer, tracer_type='QPNZ'):
"""
A Tracer type for tomographic n(z) data preresented as a `qp.Ensemble`
A Tracer type for tomographic n(z) data represented as a `qp.Ensemble`
Takes a `qp.Ensemble`
Requires the `qp` and `tables_io` packages to be installed.
Parameters
----------
name: str
Expand Down Expand Up @@ -761,6 +761,7 @@ def from_tables(cls, table_list):
Only contains one key/value pair for the one tracer.
"""
import qp

tracers = {}
sorted_dict = {}
for table_ in table_list:
Expand All @@ -772,9 +773,8 @@ def from_tables(cls, table_list):
else:
sorted_dict[table_key][table_type] = table_

for key, val in sorted_dict.items():
for val in sorted_dict.values():
meta_table = val['meta']
ensemble = qp.from_tables(val)
name = meta_table.meta['SACCNAME']
quantity = meta_table.meta.get('SACCQTTY', 'generic')
ensemble = qp.from_tables(val)
Expand Down

0 comments on commit 5d000b6

Please sign in to comment.