pyspc.core.reach.Reaches
- class pyspc.core.reach.Reaches(name='reaches')[source]
Bases :
OrderedDictClasse des collections de tronçons Reach
- name
Nom de la collection
- Type:
str
- codes
Liste des codes des tronçons
- Type:
list
- __init__(name='reaches')[source]
Initialiser l’instance de Reaches
- Paramètres:
name (str) – Nom de la collection
Methods
__init__([name])Initialiser l'instance de Reaches
add([reach, code, overwrite])Ajouter un tronçon hydrologique dans la collection
Contrôler si chaque tronçon est une instance Reach
clear()copy()from_Config([config])Créer une instance Reaches à partir d'un fichier de configuration ou d'une instance Config
fromkeys(iterable[, value])Create a new ordered dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()Return a set-like object providing a view on the dict's items.
keys()Return a set-like object providing a view on the dict's keys.
move_to_end(key[, last])Move an existing element to the end (or beginning if last is false).
pop(key[,default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem([last])Remove and return a (key, value) pair from the dictionary.
Rafraîchir la liste des codes
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
to_Config([filename])Créer une instance Config à partir d'une instance Locations
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Return an object providing a view on the dict's values.
Attributes
Liste des codes des tronçons
Nom de la collection
- add(reach=None, code=None, overwrite=False)[source]
Ajouter un tronçon hydrologique dans la collection
- Paramètres:
code (str) – Code du tronçon
reach (Reach) – Instance du tronçon
overwrite (bool) – Écraser la donnée existante ? défaut: False
- clear() None. Remove all items from od.
- property codes
Liste des codes des tronçons
- copy() a shallow copy of od
- classmethod from_Config(config=None)[source]
Créer une instance Reaches à partir d’un fichier de configuration ou d’une instance Config
- Paramètres:
config (str, Config) –
Nom du fichier de configuration
Instance pyspc.core.config.Config
- classmethod fromkeys(iterable, value=None)
Create a new ordered dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- move_to_end(key, last=True)
Move an existing element to the end (or beginning if last is false).
Raise KeyError if the element does not exist.
- property name
Nom de la collection
- pop(key[, default]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem(last=True)
Remove and return a (key, value) pair from the dictionary.
Pairs are returned in LIFO order if last is true or FIFO order if false.
- setdefault(key, default=None)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- to_Config(filename=None)[source]
Créer une instance Config à partir d’une instance Locations
- Paramètres:
filename (str) – Nom du fichier associé à la collection. Si non défini, le nom du fichier est défini à partir du nom de la collection
- Renvoie:
Instance pyspc.core.config.Config
- Type renvoyé:
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.