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

Remove array_time_step_calculator until it works properly and is tested #656

Merged
merged 1 commit into from
Jan 14, 2025
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
3 changes: 0 additions & 3 deletions torax/config/build_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from torax.stepper import linear_theta_method
from torax.stepper import nonlinear_theta_method
from torax.stepper import stepper as stepper_lib
from torax.time_step_calculator import array_time_step_calculator
from torax.time_step_calculator import chi_time_step_calculator
from torax.time_step_calculator import fixed_time_step_calculator
from torax.time_step_calculator import time_step_calculator as time_step_calculator_lib
Expand Down Expand Up @@ -725,6 +724,4 @@ def build_time_step_calculator_from_config(
return fixed_time_step_calculator.FixedTimeStepCalculator(**init_args)
elif calculator_type == 'chi':
return chi_time_step_calculator.ChiTimeStepCalculator(**init_args)
elif calculator_type == 'array':
return array_time_step_calculator.ArrayTimeStepCalculator(**init_args)
raise ValueError(f'Unknown calculator type: {calculator_type}')
13 changes: 0 additions & 13 deletions torax/config/tests/build_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from torax.stepper import linear_theta_method
from torax.stepper import nonlinear_theta_method
from torax.stepper import runtime_params as stepper_params
from torax.time_step_calculator import array_time_step_calculator
from torax.time_step_calculator import chi_time_step_calculator
from torax.time_step_calculator import fixed_time_step_calculator
from torax.transport_model import constant as constant_transport
Expand Down Expand Up @@ -511,17 +510,5 @@ def test_build_time_step_calculator_from_config(
)
self.assertIsInstance(time_stepper, expected_type)

def test_build_array_time_step_calculator(self):
time_stepper = build_sim.build_time_step_calculator_from_config({
'calculator_type': 'array',
'init_kwargs': {
'arr': [0.1, 0.2, 0.3],
},
})
self.assertIsInstance(
time_stepper, array_time_step_calculator.ArrayTimeStepCalculator
)


if __name__ == '__main__':
absltest.main()
76 changes: 0 additions & 76 deletions torax/time_step_calculator/array_time_step_calculator.py

This file was deleted.

1 change: 1 addition & 0 deletions torax/time_step_calculator/fixed_time_step_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
State = type(STATE)


# TODO(b/337844885). Make this a time dependent calculator.
class FixedTimeStepCalculator(time_step_calculator.TimeStepCalculator[State]):
"""TimeStepCalculator based on constant time steps.

Expand Down
Loading