Skip to content

Commit

Permalink
get_base_cellcountのunitcountの算出方法を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yukio89 committed Feb 20, 2024
1 parent 8397bf1 commit 80acf9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/japanmesh/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def get_mesh_vertex(x: int, x_size: float, y: int, y_size: float) -> (float, flo

@lru_cache(maxsize=None)
def get_base_cellcount(meshnum: int) -> (int, int, int):
unitcount = math.prod([info["ratio"] for idx, info in enumerate(MESH_INFOS) if 0 < idx <= meshnum])
idxs = [meshnum]
while idxs[-1]!=1:
idxs.append(MESH_INFOS[idxs[-1]]["parent"])
unitcount = math.prod([MESH_INFOS[i]["ratio"] for i in idxs])

if not MINIMUM_LON.is_integer():
raise Exception(f'Unexpected MINIMUM_LON: {MINIMUM_LON}')
Expand Down

0 comments on commit 80acf9e

Please sign in to comment.