From 8442ad5fe63eb37ca4fe9960546e99b5a93b9d5b Mon Sep 17 00:00:00 2001 From: alberto Date: Sat, 28 Nov 2026 13:26:18 -0600 Subject: [PATCH] Client for the training config --- openapi.json | 124 ++++++++++++++++++++++- src/app/api/fn/models/training-config.ts | 35 +++++++ src/app/api/functions.ts | 2 + src/app/api/models.ts | 2 + src/app/api/models/reference.ts | 11 ++ src/app/api/models/training-config.ts | 13 +++ src/app/api/models/training.ts | 6 ++ 7 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 src/app/api/fn/models/training-config.ts create mode 100644 src/app/api/models/reference.ts create mode 100644 src/app/api/models/training-config.ts diff --git a/openapi.json b/openapi.json index 7fc2035..226fb6e 100644 --- a/openapi.json +++ b/openapi.json @@ -321,7 +321,7 @@ "type": "null" } ], - "title": "Mode" + "title": "Modo" }, "scheduler": { "anyOf": [ @@ -332,10 +332,10 @@ "type": "null" } ], - "title": "Scheduler" + "title": "Planificador Dask" } }, - "title": "Execution", + "title": "Ejecuci\u00f3n", "type": "object" }, "Extract": { @@ -1266,6 +1266,31 @@ "title": "Read", "type": "object" }, + "Reference": { + "additionalProperties": false, + "properties": { + "line_hz": { + "default": 50, + "enum": [ + 50, + 60 + ], + "title": "Frecuencia de la red el\u00e9ctrica (Hz)", + "type": "integer" + }, + "name": { + "description": "Carpeta dentro de TEA_REFERENCE_ROOT con los EDF y edades.csv", + "pattern": "^[A-Za-z0-9._-]{1,64}$", + "title": "Cohorte de referencia", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Reference", + "type": "object" + }, "Rejection": { "properties": { "entity": { @@ -1947,7 +1972,8 @@ "type": "null" } ], - "title": "As Of" + "description": "Fecha de corte de los datos (por omisi\u00f3n, hoy)", + "title": "Datos hasta" }, "execution": { "anyOf": [ @@ -1966,11 +1992,51 @@ }, "title": "Models", "type": "array" + }, + "reference": { + "anyOf": [ + { + "$ref": "#/components/schemas/Reference" + }, + { + "type": "null" + } + ] } }, "title": "Training", "type": "object" }, + "TrainingConfig": { + "properties": { + "defaults": { + "additionalProperties": true, + "title": "Defaults", + "type": "object" + }, + "domain": { + "title": "Domain", + "type": "string" + }, + "json_schema": { + "additionalProperties": true, + "title": "Json Schema", + "type": "object" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "domain", + "name", + "json_schema", + "defaults" + ], + "title": "TrainingConfig", + "type": "object" + }, "ValidationError": { "properties": { "ctx": { @@ -3190,6 +3256,56 @@ ] } }, + "/models/{domain}/{name}/training-config": { + "get": { + "operationId": "training_config", + "parameters": [ + { + "in": "path", + "name": "domain", + "required": true, + "schema": { + "$ref": "#/components/schemas/Domain" + } + }, + { + "in": "path", + "name": "name", + "required": true, + "schema": { + "title": "Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainingConfig" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Training Config", + "tags": [ + "models" + ] + } + }, "/models/{domain}/{name}/versions": { "get": { "operationId": "versions", diff --git a/src/app/api/fn/models/training-config.ts b/src/app/api/fn/models/training-config.ts new file mode 100644 index 0000000..15340a9 --- /dev/null +++ b/src/app/api/fn/models/training-config.ts @@ -0,0 +1,35 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { filter, map } from 'rxjs/operators'; +import { StrictHttpResponse } from '../../strict-http-response'; +import { RequestBuilder } from '../../request-builder'; + +import { Domain } from '../../models/domain'; +import { TrainingConfig } from '../../models/training-config'; + +export interface TrainingConfig$Params { + domain: Domain; + name: string; +} + +export function trainingConfig(http: HttpClient, rootUrl: string, params: TrainingConfig$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, trainingConfig.PATH, 'get'); + if (params) { + rb.path('domain', params.domain, {}); + rb.path('name', params.name, {}); + } + + return http.request( + rb.build({ responseType: 'json', accept: 'application/json', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse; + }) + ); +} + +trainingConfig.PATH = '/models/{domain}/{name}/training-config'; diff --git a/src/app/api/functions.ts b/src/app/api/functions.ts index e409a3f..c54b2ff 100644 --- a/src/app/api/functions.ts +++ b/src/app/api/functions.ts @@ -45,6 +45,8 @@ export type { Score$Params as Score$Params } from './fn/models/score'; export { score as score } from './fn/models/score'; export type { Train$Params as Train$Params } from './fn/models/train'; export { train as train } from './fn/models/train'; +export type { TrainingConfig$Params as TrainingConfig$Params } from './fn/models/training-config'; +export { trainingConfig as trainingConfig } from './fn/models/training-config'; export type { Versions$Params as Versions$Params } from './fn/models/versions'; export { versions as versions } from './fn/models/versions'; export type { Promote$Params as Promote$Params } from './fn/models/promote'; diff --git a/src/app/api/models.ts b/src/app/api/models.ts index c5ece8f..6b3c8ac 100644 --- a/src/app/api/models.ts +++ b/src/app/api/models.ts @@ -27,6 +27,7 @@ export type { Pipeline } from './models/pipeline'; export type { Position } from './models/position'; export type { Progress } from './models/progress'; export type { Read } from './models/read'; +export type { Reference } from './models/reference'; export type { Rejection } from './models/rejection'; export type { Route } from './models/route'; export type { Run } from './models/run'; @@ -41,6 +42,7 @@ export type { Study } from './models/study'; export type { Target } from './models/target'; export type { Tasks } from './models/tasks'; export type { Training } from './models/training'; +export type { TrainingConfig } from './models/training-config'; export type { ValidationError } from './models/validation-error'; export type { Version } from './models/version'; export type { Worker } from './models/worker'; diff --git a/src/app/api/models/reference.ts b/src/app/api/models/reference.ts new file mode 100644 index 0000000..e28d9ab --- /dev/null +++ b/src/app/api/models/reference.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +export interface Reference { + line_hz?: 50 | 60; + + /** + * Carpeta dentro de TEA_REFERENCE_ROOT con los EDF y edades.csv + */ + name: string; +} diff --git a/src/app/api/models/training-config.ts b/src/app/api/models/training-config.ts new file mode 100644 index 0000000..2e61e76 --- /dev/null +++ b/src/app/api/models/training-config.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +export interface TrainingConfig { + defaults: { +[key: string]: any; +}; + domain: string; + json_schema: { +[key: string]: any; +}; + name: string; +} diff --git a/src/app/api/models/training.ts b/src/app/api/models/training.ts index 1bea9a7..cba8f8a 100644 --- a/src/app/api/models/training.ts +++ b/src/app/api/models/training.ts @@ -2,8 +2,14 @@ /* Code generated by ng-openapi-gen DO NOT EDIT. */ import { Execution } from '../models/execution'; +import { Reference } from '../models/reference'; export interface Training { + + /** + * Fecha de corte de los datos (por omisión, hoy) + */ as_of?: (string | null); execution?: (Execution | null); models?: Array; + reference?: (Reference | null); }