def intern_cell_word(word: str): word = pu.ensure_upper(word) word, res = pu.internalize(word, CELL_WORDS) if not res: raise pu.ParseError( f"'{word}' is not a valid word for cell specification") return word
def option(self, p): text: str = p.OPTION if "=" in text: text = text.replace("=", " ", 1) option, value = text.split() option = cmn.ensure_upper(option) if option in ("GAS", "ESTEP", "COND"): value = int(value) return option, value
def intern_surface_type(word: str): word = pu.ensure_upper(word) word, res = pu.internalize(word, SURFACE_TYPES) if not res: raise pu.ParseError(f"{word} is not a valid surface type") return word
def particle(self, p): result = pu.ensure_upper(p[0]) return result