Skip to content

Commit

Permalink
Fix 4d path
Browse files Browse the repository at this point in the history
  • Loading branch information
awarde96 committed Nov 21, 2024
1 parent 4602daf commit 938081f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions covjsonkit/encoder/Path.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,22 @@ def from_polytope(self, result):
}
)

print(fields)
print(coords)
print(range_dict)

for date in coords.keys():
coord = coords[date]["composite"]
coords[date]["composite"] = []
start = 0
for level in set(fields["l"]):
for s in set(fields["s"]):
cor_len = len(range_dict[(date, level, fields["number"][0], fields["param"][0], s)])
end = start + cor_len
for cor in coord[int(start) : int(end)]:
coords[date]["composite"].append([s, cor[0], cor[1], level])
start = end
if (date, level, fields["number"][0], fields["param"][0], s) in range_dict:
cor_len = len(range_dict[(date, level, fields["number"][0], fields["param"][0], s)])
end = start + cor_len
for cor in coord[int(start) : int(end)]:
coords[date]["composite"].append([s, cor[0], cor[1], level])
start = end
logging.debug("The coordinates returned from walking tree: %s", coords) # noqa: E501

combined_dict = {}
Expand Down Expand Up @@ -151,7 +156,6 @@ def from_polytope(self, result):

logging.debug("The values returned from combined dicts: %s", combined_dict) # noqa: E501

levels = fields["levels"]
if fields["param"] == 0:
raise ValueError("No parameters were returned, date requested may be out of range")
for para in fields["param"]:
Expand Down

0 comments on commit 938081f

Please sign in to comment.