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

BUG: Creating new model creates new suds client (each time) #12

Closed
and-ratajski opened this issue Apr 4, 2023 · 3 comments
Closed

BUG: Creating new model creates new suds client (each time) #12

and-ratajski opened this issue Apr 4, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@and-ratajski
Copy link

Describe the bug
Whenever one tries to create a new model after closing a new one (model = Model(True, "model_name")), following Exception gets thrown:

    model = Model(True, MODEL_NAME)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\RSTAB\initModel.py", line 126, in __init__
    cModel = Client(modelCompletePath, transport=trans, location = modelUrlPort)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\client.py", line 109, in __init__
    self.set_options(**kwargs)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\client.py", line 129, in set_options
    p.update(kwargs)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 258, in update
    self.set(n, v)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 283, in set
    self.provider(name).__set(name, value)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 428, in __set
    d.linker.updated(self, prev, value)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\options.py", line 40, in updated
    properties.link(tp)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 319, in link
    Link(self, other)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 59, in __init__
    self.validate(a, b)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 80, in validate
    raise Exception('Duplicate domain "%s" found' % d)
Exception: Duplicate domain "suds.options" found

It is because whenever a new Model instance is requested, it also creates a new suds Client for the same name and url, here:

https://github.com/Dlubal-Software/RSTAB_Python_Client/blob/14b06d28bc77731d72fe84cdaf6e71cad82161cc/RSTAB/initModel.py#L123-L127

And if there is no other workaround but to entirely close (clean) python runtime and start from the begging...

To Reproduce
Steps to reproduce the behavior:

  1. Create Model instance (model = Model(True, "model_name")).
  2. Add some materials, sections, nodes, loads, etc...
  3. Run calculations
  4. Close model
  5. Create new Model instance (model = Model(True, "new_model_name")) in the same python runtime

At this point you should see the exact same error.

Expected behavior
Creating a new model while maintaining connection to RSTAB/RFEM server.

Desktop (please complete the following information):

  • Version of WIN10 OS: Microsoft Windows Server 2022 Datacenter
  • Version of RSTAB9: 9.02.0057
  • Version of tool: 1.5.0

Additional context
Trying to compare calculations using the same model vs. creating a new model each time. If there is such a need I can provide my testing script.

@and-ratajski and-ratajski added the bug Something isn't working label Apr 4, 2023
@dogukankaratas
Copy link
Contributor

Hi,
Fixed in the main branch.

@and-ratajski
Copy link
Author

Hi @dogukankaratas ,
So does it mean that this issue is resolved (fixed, tested, deployed) and soft pushed to pip repository?

By the way - what is the release strategy? Each fix would be available as new release or do you plan to group them and release together (milestones)?

@OndraMichal
Copy link
Contributor

OndraMichal commented Apr 18, 2023

Hi @and-ratajski,
every update is available in main branch immediately after code review. We don't publish every change on pypi.org page. We release the client when there is substantial work done. No milestones are set. This is same for both RFEM and RSTAB. But all development is done in RFEM. Then after there is considerable work done, relevant changes are copied, since RSTAB functions are subset of RFEM's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants