Skip to content

Commit

Permalink
Reorganización general
Browse files Browse the repository at this point in the history
  • Loading branch information
julienmalard committed Dec 8, 2023
1 parent 1549a5b commit 5b22728
Show file tree
Hide file tree
Showing 15 changed files with 493 additions and 165 deletions.
93 changes: 91 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ frozendict = "^2.3.4"
mypy = {git = "https://github.com/python/mypy.git"}
data-science-types = "^0.2.23"
pyright = "^1.1.270"
black = "^22.8.0"

[tool.mypy]
plugins = "numpy.typing.mypy_plugin"
Expand Down
9 changes: 5 additions & 4 deletions tikon/ecs/árb_coso.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from typing import Dict

from .dists import DistAnalítica, ManejadorDists
from ..central import Coso


class PlantillaRamaEcCoso(dict):
def __init__(símismo, pariente, ramas, coso):
def __init__(símismo, pariente, ramas, coso: Coso):
símismo.coso = coso
símismo.nombre = pariente.nombre
símismo.pariente = pariente
Expand All @@ -21,7 +22,7 @@ def de_dic(símismo, dic):
if rm in dic:
símismo[rm].de_dic(dic[rm])

def borrar_calib(símismo, nombre):
def borrar_calib(símismo, nombre: str):
for rm in símismo:
símismo[rm].borrar_calib(nombre)

Expand Down Expand Up @@ -68,7 +69,7 @@ def desactivar_ec(símismo, categ, subcateg=None):

class CategEcCoso(PlantillaRamaEcCoso):

def activar_ec(símismo, subcateg, ec):
def activar_ec(símismo, subcateg: str, ec: str):
símismo[subcateg].activar_ec(ec)

def desactivar_ec(símismo, subcateg=None):
Expand All @@ -91,7 +92,7 @@ def __init__(símismo, pariente, ramas, coso):
def activa(símismo, modelo, mód, exper, coso):
return símismo.ec_activa().activa(modelo, mód, exper, coso)

def activar_ec(símismo, ec):
def activar_ec(símismo, ec: str):
try:
obj_ec = símismo[ec]
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion tikon/móds/cultivo/cult.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(símismo, mód, simul_exper, ecs, vars_interés):
raise ErrorRequísitos('Falta módulo RedAE requerido por Cultivo.')

símismo.mód_red = simul_exper.modelo[RedAE.nombre]
símismo.orgs = [org for org in símismo.mód_red.orgs if isinstance(org, CultivoExterno)]
símismo.orgs = [org for org in símismo.mód_red.organismos if isinstance(org, CultivoExterno)]
símismo.etapas = [etp for org in símismo.orgs for etp in org]

super().__init__(mód=mód, simul_exper=simul_exper, ecs=ecs, vars_interés=vars_interés)
Expand Down
2 changes: 1 addition & 1 deletion tikon/móds/cultivo/extrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def obt_org(símismo, cultivo, variedad=None):
orgs_potenciales = símismo.parcelas.conv_cultivos[cultivo]
else:
_cls_apropriada = _cls_cultivos[cultivo.lower()]
orgs_potenciales = [org for org in símismo.sim.orgs if isinstance(org, _cls_apropriada)]
orgs_potenciales = [org for org in símismo.sim.organismos if isinstance(org, _cls_apropriada)]
if variedad:
return next(
(clt for clt in orgs_potenciales if clt.variedad and clt.variedad.lower() == variedad.lower()),
Expand Down
3 changes: 2 additions & 1 deletion tikon/móds/rae/manejo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from tikon.móds.manejo.acciones import Acción
from tikon.móds.manejo.conds import CondVariable
from tikon.móds.rae.utils import RES_POBS, EJE_ETAPA
from .orgs.organismo import Etapa, SumaEtapas, Organismo
from .orgs.organismo import Organismo
from .orgs.etapa import Etapa, SumaEtapas
from .red import RedAE


Expand Down
Loading

0 comments on commit 5b22728

Please sign in to comment.