From 6051ad8f25daf6f90f18f9c064d345500efde88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Thu, 30 May 2024 09:35:00 +0200 Subject: [PATCH] CLN: drop unused and duplicated parsing logic in AMRex frontend --- yt/frontends/amrex/fields.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/yt/frontends/amrex/fields.py b/yt/frontends/amrex/fields.py index 8ce65068a7..cf193326c5 100644 --- a/yt/frontends/amrex/fields.py +++ b/yt/frontends/amrex/fields.py @@ -1,5 +1,4 @@ import re -import string import numpy as np @@ -369,14 +368,6 @@ def setup_fluid_fields(self): function=func, units=self.ds.unit_system["density"], ) - # We know this will either have one letter, or two. - if field[3] in string.ascii_letters: - element, weight = field[2:4], field[4:-1] - else: - element, weight = field[2:3], field[3:-1] # NOQA - - # Here we can, later, add number density - # right now element and weight inferred above are unused class MaestroFieldInfo(FieldInfoContainer): @@ -491,20 +482,6 @@ def setup_fluid_fields(self): display_name=rf"\rho {tex_label}", ) - # Most of the time our species will be of the form - # element name + atomic weight (e.g. C12), but - # sometimes we make up descriptive names (e.g. ash) - if any(char.isdigit() for char in field): - # We know this will either have one letter, or two. - if field[3] in string.ascii_letters: - element, weight = field[2:4], field[4:-1] - else: - element, weight = field[2:3], field[3:-1] # NOQA - weight = int(weight) - - # Here we can, later, add number density using 'element' and - # 'weight' inferred above - elif field.startswith("omegadot("): nice_name, tex_label = _nice_species_name(field) display_name = rf"\dot{{\omega}}\left[{tex_label}\right]"