Replies: 5 comments 2 replies
|
What do you mean? What do you replace the OrderedDict with? |
0 replies
|
a regular dictionary |
0 replies
|
an example variables = {
'ID': {'dtype': np.int32, # Unique numerical identifier
'seed': False,
'default': -1}, # ID to be assigned by application
'status': {'dtype': np.int32, # Status categories
'seed': False,
'default': 0},
'moving': {'dtype': np.int32, # Set to 0 for elements which are frosen
'seed': False,
'default': 1},
'age_seconds': {'dtype': np.float32,
'units': 's',
'seed': False,
'default': 0},
'origin_marker': {'dtype': np.int16,
'unit': '',
'description': '''An integer kept constant during the simulation.
Different values may be used for different seedings,
to separate elements during analysis.
With GUI, only a single seeding is possible.''',
'default': 0},
'lon': {'dtype': np.float32,
'units': 'degrees_east',
'standard_name': 'longitude',
'long_name': 'longitude',
'seed': False,
'axis': 'X'},
'lat': {'dtype': np.float32,
'units': 'degrees_north',
'standard_name': 'latitude',
'long_name': 'latitude',
'seed': False,
'axis': 'Y'},
'z': {'dtype': np.float32,
'units': 'm',
'standard_name': 'z',
'long_name': 'vertical position',
'axis': 'Z',
'positive': 'up',
'default': 0}
} |
0 replies
|
Ok, some places can probably be replaced with regular dicts. Like the one you suggest. But many other places require the order, like priority_readers. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
OrderectDict specifics used by Opendrift has been part of python since 3.6 and doesn't need to be part of it anymore. It also slower than the native dictionaries present in python 3 apparently. Collection is also not very supported for that side of things if I understood well.
I have found these occurrences in the code
https://github.com/search?q=repo%3AOpenDrift%2Fopendrift%20OrderedDict&type=code
In 10 minutes I have removed the imports and the use of it.
OpenDrift works perfectly fine without it and it is an opportunity to remove a library import and a layer of clutter.
All reactions