Skip to content

Commit

Permalink
temporarily move REGEX_DICT to respective files to fix module import …
Browse files Browse the repository at this point in the history
…issue
  • Loading branch information
pranabdas committed May 24, 2024
1 parent 0dbbe45 commit 84ddf21
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
15 changes: 14 additions & 1 deletion src/load_ses_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@
import zipfile
import re
import numpy as np
from src.utils import REGEX_DICT


REGEX_DICT = {"num_int": r"[+-]?\d+"}
REGEX_DICT.update({"num_dbl": r"[-+]?\d*\.\d+(?:[eE][-+]?\d+)?"})
REGEX_DICT.update({"map_width": (r"^\s*width\s*=\s*{0}").format(REGEX_DICT["num_int"])})
REGEX_DICT.update({"map_height": (r"^\s*height\s*=\s*{0}").format(REGEX_DICT["num_int"])})
REGEX_DICT.update({"map_depth": (r"^\s*depth\s*=\s*{0}").format(REGEX_DICT["num_int"])})
REGEX_DICT.update({"map_data_path": r"^\s*path\s*=\s*."})
REGEX_DICT.update({"map_width_offset": (r"^\s*width_offset\s*=\s*{0}").format(REGEX_DICT["num_dbl"])})
REGEX_DICT.update({"map_height_offset": (r"^\s*height_offset\s*=\s*{0}").format(REGEX_DICT["num_dbl"])})
REGEX_DICT.update({"map_depth_offset": (r"^\s*depth_offset\s*=\s*{0}").format(REGEX_DICT["num_dbl"])})
REGEX_DICT.update({"map_width_delta": (r"^\s*width_delta\s*=\s*{0}").format(REGEX_DICT["num_dbl"])})
REGEX_DICT.update({"map_height_delta": (r"^\s*height_delta\s*=\s*{0}").format(REGEX_DICT["num_dbl"])})
REGEX_DICT.update({"map_depth_delta": (r"^\s*depth_delta\s*=\s*{0}").format(REGEX_DICT["num_dbl"])})


def load_ses_map(filename):
Expand Down
7 changes: 6 additions & 1 deletion src/load_ses_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
import re
import urllib.request
import numpy as np
from src.utils import REGEX_DICT

REGEX_DICT = {"num_int": r"[+-]?\d+"}
REGEX_DICT.update({"num_dbl": r"[-+]?\d*\.\d+(?:[eE][-+]?\d+)?"})
REGEX_DICT.update({"energy_len": (r"^\s*Dimension\s+1\s+size\s*=\s*{0}").format(REGEX_DICT["num_int"])})
REGEX_DICT.update({"angle_len": (r"^\s*Dimension\s+2\s+size\s*=\s*{0}").format(REGEX_DICT["num_int"])})
REGEX_DICT.update({"angle_data": r"^\s*Dimension\s+2\s+scale\s*="})


def load_ses_spectra(filename):
Expand Down
23 changes: 0 additions & 23 deletions src/utils.py

This file was deleted.

0 comments on commit 84ddf21

Please sign in to comment.