Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix replace-output-directory #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Roy-Haolin-Du
Copy link
Contributor

Description

Ensure only the last part of the path is changed.
input_calc/bound/input would get replaced with input_calc/bound/output, rather than output_calc/bound/output.

Close #34.

Status

  • Ready to go

Could you please review @fjclark

output_dir="/".join(
self.stage_input_dirs[stage_type].split("/")[:-1]
)
+ "/output",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, here I would do:

output_dir = os.path.join(self.stage_input_dirs[stage_type], "output")

if leg.leg_type == a3.LegType.BOUND:
expected_output_dir = "output".join(
stage.input_dir.rsplit("input", 1)
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use os.path.join. Thanks!

@@ -348,6 +349,38 @@ def setup_calc(mock_run_process):
setup_calc.setup(bound_leg_sysprep_config=cfg, free_leg_sysprep_config=cfg)
yield setup_calc

@pytest.fixture
def setup_calc_with_input_path(self, setup_calc):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just change all of these tmp dirs to used "temp_input_" - this will reduce duplication and speed things up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leg replaces "input" with "output" in any part of calculations path
2 participants