Skip to content

Commit

Permalink
removing reading with parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleyna Akyuz authored and Aleyna Akyuz committed Dec 3, 2024
1 parent 0a909d9 commit c9dd529
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pycbc/types/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def __init__(

super().__init__()

self.read_ini_file(configFiles)

# Enable case sensitive options
self.optionxform = str

Expand All @@ -119,6 +117,8 @@ def __init__(
}
self.read_dict({'environment': env_vals})

self.read_ini_file(configFiles)

# Split sections like [inspiral&tmplt] into [inspiral] and [tmplt]
self.split_multi_sections()

Expand Down Expand Up @@ -250,17 +250,16 @@ def read_ini_file(self, fpath):
options_seen = {}

for filename in fpath:
parser = ConfigParser.ConfigParser()
parser.read(filename)
self.read(filename)

for section in parser.sections():
for section in self.sections():
if section == "environment":
continue
else:
if section not in options_seen:
options_seen[section] = set()

section_options = parser.options(section)
section_options = self.options(section)

option_intersection = options_seen[section].intersection(section_options)

Expand All @@ -269,7 +268,6 @@ def read_ini_file(self, fpath):

options_seen[section].update(section_options)

self.read(fpath)

def get_subsections(self, section_name):
"""Return a list of subsections for the given section name"""
Expand Down

0 comments on commit c9dd529

Please sign in to comment.