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

Tickets/dm 48022 #254

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Tickets/dm 48022 #254

merged 2 commits into from
Dec 12, 2024

Conversation

iglesu
Copy link
Contributor

@iglesu iglesu commented Dec 10, 2024

https://rubinobs.atlassian.net/browse/DM-48022

Deprecate ignore_m1m3 added disable_m1m3_force_balance property

- Deprecate `ignore_m1m3` property.
- Added new property `disable_m1m3_force_balance` with default `false`.
    Maintains the ability to disable the M1M3 balance system, in case
    the coupling effect between the elevation axis and m1m3
    support system, repeats again, driving the system to a huge
    oscillation
- Added unit tests for the property deprecation and the new one

@iglesu iglesu requested a review from tribeiro December 10, 2024 01:07
@@ -75,6 +75,10 @@ def get_schema(cls):
description: Ignore the m1m3 component?
type: boolean
default: false
Copy link
Member

Choose a reason for hiding this comment

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

You might want to remove the default value here or it will always trigger the deprecation warning. Also, please add a note in the description that this is going to be deprecated.

@@ -107,8 +115,3 @@ async def run(self):
elapsed_time = end_time - start_time

self.log.info(f"Homing both axes took {elapsed_time:.2f} seconds")

if not self.ignore_m1m3:
Copy link
Member

Choose a reason for hiding this comment

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

if you disabled it, you need to enable it back here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I follow. ignore_m1m3 it's basically removed. So there is no "ignore_m1m3" property.

Copy link
Member

Choose a reason for hiding this comment

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

but we added the disable_m1m3_force_balance option....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aah got it! of course we disable it on the CSC not the script!

In that case we want to keep the warn_wait? See that originally we had a asyncio.sleep just b4 enabling the balance system.

Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove it.

self.home_both_axes_timeout = 300.0 # timeout to home both MTMount axes.

self.ignore_m1m3 = False
self.warn_wait = 10.0
Copy link
Member

Choose a reason for hiding this comment

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

I think you can remove this attribute now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is removed already, see the "-"

Copy link
Member

Choose a reason for hiding this comment

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

I mean the warn_wait....

self.ignore_m1m3 = config.ignore_m1m3

if hasattr(config, "ignore_m1m3"):
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

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

this warning will be printed to stdout (or stderr, I am not sure) but won't be logged. Please, add a self.log.warning call here as well.

@@ -0,0 +1,6 @@
Deprecate `ignore_m1m3` property.
Copy link
Member

Choose a reason for hiding this comment

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

There's a "removal" type you can probably use to document this one.

Please, split both of these notes in 2 different files.

@@ -0,0 +1,6 @@
Deprecate `ignore_m1m3` property.
Added new property `disable_m1m3_force_balance` with default `false`.
Maintains the ability to disable the M1M3 balance system, in case
Copy link
Member

Choose a reason for hiding this comment

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

I think you can remove this space here before each line. Also, we use "semantic line breaking" so please, make sure each phrase is in one line.

Copy link
Member

@tribeiro tribeiro left a comment

Choose a reason for hiding this comment

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

looks good! thanks

pkubanek and others added 2 commits December 12, 2024 09:54
need to disable balance system when homing.

Deprecate ignore_m1m3 added disable_m1m3_force_balance property

- Deprecate `ignore_m1m3` property.
- Added new property `disable_m1m3_force_balance` with default `false`.
@iglesu iglesu merged commit a6e6525 into develop Dec 12, 2024
2 checks passed
@iglesu iglesu deleted the tickets/DM-48022 branch December 12, 2024 18:58
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.

3 participants