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

Fix errors with numpy2 #10

Closed

Conversation

t-imamichi
Copy link

docplex raises an error with numpy 2.
This PR fixes them.

This PR also fixes an escape error of a docstring.

try:
    from docplex.cp.model import CpoModel
except Exception as ex:
    print(ex)
try:
    from docplex.mp.model import Model
except Exception as ex:
    print(ex)

docplex 2.27.239

`np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.
`np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.

this PR

@@ -1089,7 +1089,7 @@ def remove_abort_callback(cb):


def make_attachment_name(name):
'''From `name`, create an attachment name that is correct for DOcplexcloud.
r'''From `name`, create an attachment name that is correct for DOcplexcloud.
Copy link
Author

Choose a reason for hiding this comment

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

This change fixes the following syntax warning.

SyntaxWarning: invalid escape sequence '\?'
  '''From `name`, create an attachment name that is correct for DOcplexcloud.

@t-imamichi
Copy link
Author

#12 fixed the issue.

@t-imamichi t-imamichi closed this Aug 5, 2024
@t-imamichi t-imamichi deleted the fix-numpy2 branch August 5, 2024 01: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.

1 participant