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

Integration branch for FastAPI and other PRs #177

Closed
wants to merge 25 commits into from

Commits on Oct 11, 2024

  1. Migrate from Flask to FastAPI

     * FastAPI migration:
        - Use pydantic model classes as input parameters to the
          data/calculation classes.
        - Interface field names changed to constructor parameter names (for
          simplicity only during transition, should be updated in a followup
          PR).
        - Add basic interface requirements (e.g. some values > 0, etc.).
     * Update tests for new data format.
     * Python requirement down to 3.9 (TypeGuard no longer needed)
     * Makefile: Add helpful targets (e.g. development server with reload)
    Lasall committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    9e3c756 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2024

  1. Move API doc from README to pydantic model classes (swagger)

     * Add API to sphynx doc (rudimental, due to outdated plugin).
     * Link to swagger.io with own openapi.yml.
     * Commit openapi.json and check with pytest for changes so the
       documentation is always up-to-date.
    Lasall committed Oct 12, 2024
    Configuration menu
    Copy the full SHA
    8458684 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2024

  1. Add package API documentation generation

    Add generation of the API documentation for akkudoktoreos
    and akkudoktoreosserver packages.
    
    The API documentation is generated by the Sphinx autosummary extension.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    2277d1f View commit details
    Browse the repository at this point in the history
  2. Enable Google style source commenting and documentation generation.

    Enable automatic documentation generation from Google style docstrings in the source.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    a1cef1e View commit details
    Browse the repository at this point in the history
  3. Check Google style source commenting.

    Check Google style commenting by the appropriate ruff rules.
    
    Commenting is _NOT_ enforced. Missing docstrings are ignored.
    
    Minor commenting quirks of the code base are adapted.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    882aae6 View commit details
    Browse the repository at this point in the history
  4. Add settings and extension recommendations

    Chris authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    906c652 View commit details
    Browse the repository at this point in the history
  5. Add pyright section for pylance extension

    Chris authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    f6e8ada View commit details
    Browse the repository at this point in the history
  6. Enable pytest and debugging

    - replace outdated modules with src
    - removed cov arg from pyproject toml
    - add settings
    Chris authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    6d09e44 View commit details
    Browse the repository at this point in the history
  7. Prettier files

    Chris authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    53905cb View commit details
    Browse the repository at this point in the history
  8. Bump sphinx from 8.0.2 to 8.1.3

    Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.0.2 to 8.1.3.
    - [Release notes](https://github.com/sphinx-doc/sphinx/releases)
    - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
    - [Commits](sphinx-doc/sphinx@v8.0.2...v8.1.3)
    
    ---
    updated-dependencies:
    - dependency-name: sphinx
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    685e855 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7ab9314 View commit details
    Browse the repository at this point in the history
  10. test_load_corrector

    NormannK authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    1f50eb5 View commit details
    Browse the repository at this point in the history
  11. Streamline Dockerfile, remove unused deps

     * Dockerfile: Use non-root user, buildx cache, setup for readonly
       container, remove unused apt deps.
       For now don't install pip package and keep development flask server
       as this will be replaced in the future (fastapi). Then a proper
       webserver (e.g. nginx) should be used and the pip package can be
       created and deployed just to the run-stage (with the webserver).
     * docker-compose: Set to readonly (anonymous volumes declared in
       Dockerfile should maintain all writable data).
       Mount config.py for easier development. Should be replaced by
       environment support for all config file variables.
     * Remove unused runtime dependencies: mariadb, joblib, pytest,
       pytest-cov.
     * Move pytest-cov to dev dependencies.
     * Add output_dir to config.py.
     * Fix visualization_results.pdf endpoint.
     * Update docs.
    Lasall authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    e08e2b5 View commit details
    Browse the repository at this point in the history
  12. Ruff format

    Chris authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    0923584 View commit details
    Browse the repository at this point in the history
  13. rebase fixes

    NormannK authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    7763b1f View commit details
    Browse the repository at this point in the history
  14. ruff changes

    NormannK authored and b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    2952cda View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    676b4d8 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    1f0ee74 View commit details
    Browse the repository at this point in the history
  17. Add documentation to class_pv_forecast.py.

    Added documentation. Beware mostly generated by ChatGPT.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    4186937 View commit details
    Browse the repository at this point in the history
  18. Add CacheFileStore, to_datetime and get_logger utilities.

    The `CacheFileStore` class is a singleton-based, thread-safe key-value store for managing
    temporary file objects, allowing the creation, retrieval, and management of cache files.
    
    The utility modules offer a flexible logging setup (`get_logger`) and utilities to handle
    different date-time formats (`to_datetime`, `to_timestamp`).
    
    - Cache files are automatically valid for the the current date unless specified otherwise.
      This is to mimic the current behaviour used in several classes.
    - The logger supports rotating log files to prevent excessive log file size.
    - The `to_datetime` and `to_timestamp`functions support a wide variety of input types and formats.
      They provide the time conversion that is e.g. used in PVForecast.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    1fbdd18 View commit details
    Browse the repository at this point in the history
  19. Improve testability of PVForecast

    Improvements for testing of PVForecast
    - Use common utility functions to allow for general testing at one spot.
      - to_datetime
      - CacheFileStore
    - Use logging instead of print to easily capture in testing.
    - Add validation of the json schema for Akkudoktor PV forecast data.
    - Allow to create an empty PVForecast instance as base instance for testing.
    - Make process_data() complete for filling a PVForecast instance for testing.
    - Normalize forecast datetime to timezone of system given in loaded data.
    - Do not print report but provide report for test checks.
    - Get rid of cache file path using the CachFileStore to automate cache file usage.
    - Improved module documentation.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    d38b24a View commit details
    Browse the repository at this point in the history
  20. Add test for PVForecast and newly extracted utility modules.

    - Add test for PVForecast
    - Add test for CacheFileStore in the new cachefilestore module
    - Add test for to_datetime in the new datetimeutil module
    - Add test for get_logger in the new logutil module
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    7ad1eea View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    ba52724 View commit details
    Browse the repository at this point in the history
  22. Tool to integrate EOS PRs in an integration branch.

    This script automates the integration of multiple GitHub pull requests (PRs)
    into a specified integration branch. It fetches each PR, creates a branch
    from the PR, rebases the branch onto the integration branch, and then merges
    it back into the integration branch. The process is logged to a branch-specific
    log file, and if any step fails, the script exits and saves the current progress
    (PR number and step) to a branch-specific JSON file. The script can be rerun,
    and it will resume from where the last step failed. If the script is run again
    on the same branch without providing PR numbers, it will reuse the PR numbers
    from the first run.
    
    Signed-off-by: Bobby Noelte <[email protected]>
    b0661 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    1f5abf3 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    14a1be6 View commit details
    Browse the repository at this point in the history