Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions utils/check_modular_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def process_file(modular_file_path, generated_modeling_content, file_type="model
file_name_suffix = file_type.split("*")[-1] if "*" in file_type else ""
file_path = modular_file_path.replace("modular_", f"{file_name_prefix}_").replace(".py", f"{file_name_suffix}.py")
# Read the actual modeling file
with open(file_path, "r") as modeling_file:
with open(file_path, "r", encoding="utf-8") as modeling_file:
content = modeling_file.read()
output_buffer = StringIO(generated_modeling_content[file_type][0])
output_buffer.seek(0)
Expand All @@ -39,7 +39,7 @@ def process_file(modular_file_path, generated_modeling_content, file_type="model
# Check for differences
if diff_list:
if fix_and_overwrite:
with open(file_path, "w") as modeling_file:
with open(file_path, "w", encoding="utf-8", newline="\n") as modeling_file:
modeling_file.write(generated_modeling_content[file_type][0])
console.print(f"[bold blue]Overwritten {file_path} with the generated content.[/bold blue]")
else:
Expand Down
2 changes: 1 addition & 1 deletion utils/create_dependency_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def topological_sort(dependencies: dict):

# Function to extract class and import info from a file
def extract_classes_and_imports(file_path):
with open(file_path, "r") as file:
with open(file_path, "r", encoding="utf-8") as file:
tree = ast.parse(file.read(), filename=file_path)
imports = set()

Expand Down