Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ant 2809 read json #5

Merged
merged 21 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ FROM inca.rte-france.com/antares/python3.11-rte:1.1
# Add the `ls` alias to simplify debugging
RUN echo "alias ll='/bin/ls -l --color=auto'" >> /root/.bashrc

WORKDIR /code/datamanager

COPY ./requirements.txt ./conf/* /conf/
COPY ./datamanager /code/datamanager
# Configure Python RTE mirrors
RUN echo "[global]" >> /etc/pip.conf &&\
echo " index = https://devin-depot.rte-france.com/repository/pypi-all" >> /etc/pip.conf &&\
echo " index-url = https://devin-depot.rte-france.com/repository/pypi-all/simple" >> /etc/pip.conf &&\
echo " trusted-host = devin-depot.rte-france.com" >> /etc/pip.conf

RUN pip3 install --no-cache-dir --upgrade pip && pip3 install --no-cache-dir -r /conf/requirements.txt

# Copy the application source code
COPY ./src/antares /code/antares

ENV PYTHONPATH="/code"

EXPOSE 8094

# Run the FastAPI application
CMD ["uvicorn", "antares.main:app", "--host", "0.0.0.0", "--port", "8094"]

#CMD ["uvicorn", "--app-dir", "/code", "datamanager.main:app", "--host", "0.0.0.0", "--port", "8094"]
CMD ["python3", "main.py"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# This file is part of the Antares project.

from antares.env_variables import EnvVariableType
from datamanager.env_variables import EnvVariableType


class APIGeneratorConfig:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import pandas as pd

from antares import craft
from antares.APIGeneratorConfig.config import APIGeneratorConfig
from antares.craft.api_conf.api_conf import APIconf
from antares.craft import APIconf
from antares.craft.model.area import AreaUi
from antares.env_variables import EnvVariableType
from antares.exceptions.exceptions import APIGenerationError, AreaGenerationError, LinkGenerationError
from antares.utils.areaUi import generate_random_color, generate_random_coordinate

from datamanager.APIGeneratorConfig.config import APIGeneratorConfig

from datamanager.env_variables import EnvVariableType
from datamanager.exceptions.exceptions import APIGenerationError, AreaGenerationError, LinkGenerationError
from datamanager.utils.areaUi import generate_random_color, generate_random_coordinate


def generate_study(study_id: str) -> dict[str, str]:
Expand Down
6 changes: 3 additions & 3 deletions src/antares/main.py → datamanager/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

import uvicorn

from antares.generator.readJsonForGeneration import generate_study
from datamanager.generator.readJsonForGeneration import generate_study
from fastapi import FastAPI

app = FastAPI(
title="antares-datamanager-generator", description="API to launch antares study generation", version="0.0.1"
title="datamanager-datamanager-generator", description="API to launch datamanager study generation", version="0.0.1"
)


Expand All @@ -26,4 +26,4 @@ def create_study(study_id: str) -> dict[str, str]:


if __name__ == "__main__":
uvicorn.run("main:app", host="127.0.0.1", port=8094, reload=True)
uvicorn.run("main:app", host="0.0.0.0", port=8094, reload=True)
12 changes: 12 additions & 0 deletions datamanager/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024, RTE (https://www.rte-france.com)
#
# See AUTHORS.txt
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# SPDX-License-Identifier: MPL-2.0
#
# This file is part of the Antares project.

File renamed without changes.
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-r requirements.txt
coverage[toml]~=7.6.1
mkdocs~=1.6.1
mkdocstrings[python]~=0.26.1
mkdocs-material~=9.5.40
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
absl-py~=1.4.0
click~=8.1.7
configparser~=5.0.2
numpy~=1.26.4
Expand Down
Loading