Skip to content

Conversation

@OndraMichal
Copy link
Contributor

US-8506: Web Services: Python: Improvement in initialization of connection with RFEM6

Description:
Purpose of this task is to add new options to input dialogue to enable use already existing models in RFEM or create new one. Edit name of the new model. If existing one is selected then enable deleting results and reset of the model. This envolves changes in initModle.py file to enable loading of existing models befor showing dialogue and then effective use of clientModel ( by creating Model class).

MichalO added 2 commits November 2, 2021 08:44
to create model or use existing one,
to delete results,
and to reset model.
Added Model class to initModel to be able to first load models from RFEM and then offer them in dialogue.
clientModel is now class variable of Model class.
if __name__ == '__main__':
l = float(input('Length of the cantilever in m: '))
f = float(input('Force in kN: '))

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding Model class definition
Model(model_name='Demo1')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved

input('Press Enter to exit...')
sys.exit()

# RFEM 6
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding Model class definition
Model(model_name='Cantilever')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved

from RFEM.LoadCasesAndCombinations.designSituation import *

if __name__ == '__main__':

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding Model Class definition
Model(model_name='DesignSituations_Test')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected.
Error: Invalid design situation type.' still persist. Out of the scope of this code review.

Copy link
Contributor

Choose a reason for hiding this comment

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

Björn is taking care of that error. @Bjoern-Steinhagen

if __name__ == '__main__':
clientModel.service.begin_modification('new')
Model.clientModel.service.begin_modification('new')

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding Model Class definition
Model(model_name='FreeLoad_test')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved

from RFEM.initModel import *

if __name__ == '__main__':

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding Model Class definition
Model(model_name = 'GlobalParameters_test'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved
suds.WebFault: Server raised fault: 'Enumeration item 'DEFINITION_TYPE_OPTIMIZATION' not found.' still persist.

from RFEM.initModel import clearAtributes, Model

class Material():
class Material(Model):
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to inherit Model class. Importing is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

inheritance removed

clientModel = cModel
class Model():
clientModel = None
def __init__(self,
Copy link
Contributor

Choose a reason for hiding this comment

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

Some arguments are not using by the function and should be removed. Also adding defaults values could be useful.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved

cModel.service.reset()

Model.clientModel = cModel
print('Geometry...')
Copy link
Contributor

Choose a reason for hiding this comment

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

print("Ready!") looks better than print('Geometry...'). Should we discuss it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well we can print what ever we agree on. By this messages I wanted to comunicate to user, which part of script is running. If Ready seems more appropriate, we can change it. Maybe we should vote on things like that. There is no 100% correct solution.



def test_material():

Copy link
Contributor

Choose a reason for hiding this comment

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

Model(model_name = 'basicobjects_test')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved

main.py Outdated
clientModel.service.begin_modification('new')
print('Geometry...')

Model(hall_width_L, hall_height_h_o, hall_height_h_m, number_frames, frame_spacing, new_model, model_name, delete, reset)
Copy link
Contributor

Choose a reason for hiding this comment

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

Acc. to previous suggestions, line 28 should be change as;

Model(new_model, model_name, delete, reset)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved

Copy link
Contributor

@dogukankaratas dogukankaratas left a comment

Choose a reason for hiding this comment

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

  • Conflicts should be solven.

@jarabroz jarabroz disabled auto-merge December 1, 2021 12:29
@pull-request-quantifier-deprecated

This PR has 1250 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Large
Size       : +661 -589
Percentile : 100%

Total files changed: 82

Change summary by file extension:
.py : +661 -589

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@jarabroz jarabroz merged commit a5663f0 into main Dec 1, 2021
@jarabroz jarabroz deleted the OndrejMichal-AddOptionsToDialog branch December 1, 2021 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants