Skip to content

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented May 9, 2022

This PR does two things:

>>> mapdl.parameters['TWO'] = 2.0
>>> "TWO" in mapdl.parameters
True
>>> "THREE" in mapdl.parameters
False

Because of the __iter__:

>>> for each in mapdl.parameters:
>>>     print(each)
"TWO"

Simple things, that I believe they will be useful.

germa89 added 2 commits May 9, 2022 22:12
Add scape when there is no parameters defined.
@germa89 germa89 added this to the v0.61.6 milestone May 9, 2022
@germa89 germa89 self-assigned this May 9, 2022
@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #1108 (d47a9a6) into main (95ce5cf) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1108      +/-   ##
==========================================
- Coverage   73.31%   73.31%   -0.01%     
==========================================
  Files          43       43              
  Lines        6428     6434       +6     
==========================================
+ Hits         4713     4717       +4     
- Misses       1715     1717       +2     

Copy link
Collaborator

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

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

Agree with the implementation. We've made parameters a dict-like, and as such we should include these dunder methods as well.

@akaszynski akaszynski merged commit 2fb7a56 into main May 9, 2022
@akaszynski akaszynski deleted the fix/empty-parameters branch May 9, 2022 22:01
@germa89
Copy link
Collaborator Author

germa89 commented May 10, 2022

I wonder if we shouldn't have just inheritate from dict. I recall you were happy to do that for the "info" module, but not sure about this case.

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.

Value Error if defining a parameter in the Begin level

2 participants