Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

def delete(self, ids_name, occurrence=0):

IDS superclass

IDSBase  - Parent class for all classes representing particular IDSes. 

...

Warning
titleBackward compatibility

Backward compatibility, understood as possibility of using 'old' and 'new' approach at the same time is :(plus) Can be achieved without big effort, as content of IDS class will not change (a lot)kept:

(plus) All 'old' scripts will work - no modifications needed →  users are happy (smile)needed 

(minus) Currently all methods use context kept in IDS that was a reason of many problems. New API is designed to overcome this issue. Keeping compatibility means that methods still have to be able to use context stored in IDS that is error prone.

(minus) All unwanted, messy methods operating on context stored (setCtx, etc)  must be kept 


Compatibility can be also ensured by introducing new names of methods - putSlice  vs put_slice 

...

Code Block
import imas
ids_wall = imas.wall.wall()

TO DO / Open points

IDS superclass

...


IDS names

Code Block
ids = db_entry.get('pf_active')

...

It can be implemented using enum or class attribute

Enum

class IDSName(enum): 

     EQUILIBRIUM = 'equilibrium'

...

Warning

It is not enough to call IDSName.WALL  to get string value of enumerator. Because of Python enumerator implementation, one has to call IDSName.WALL.value to get 'wall' string.


Given IDS class attribute

e.g. Wall.__name__

Code Block
ids = db_entry.get(Wall.__name__)

...