Giter VIP home page Giter VIP logo

factryengine's Introduction

WELCOME

Getting started

  1. Install VS Code and Docker Desktop
  2. Install Remote Development Extension for VS Code
  3. Clone repo
  4. Open in VS CODE, then you should see the following notification (Click Reopen in Container):

Development setup

  1. Duplicate .env.template and rename it .env and add the secrets.

  2. Then Ctrl + Shift + P and select Dev Containers: Rebuild Container

  3. Then Ctrl + Shift + P and select Developer: Reload Window this will ensure that the extensions and formatters work properly. This only needs to be done after a container rebuild.

  4. Run make migrations in terminal to create new migratrions.

  5. Run make migrate in terminal to migrate changes in the database.

  6. Run make sync_roles in terminal to add user roles in the database.

  7. Run make dev in terminal to run django.

Production

  1. Duplicate .env.template and rename it to .env, then add the necessary secrets. Ensure that the value of the DJANGO_ENV environment variable is set to production.
  2. Run docker compose up --build in terminal to build the container and to run the server

SQLite database is set up for development purposes, while PostgreSQL is used for the production environment.

factryengine's People

Contributors

yacobolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nathanjr123

factryengine's Issues

ValueError: All matrices must have the same intervals on example notebook

the task Example 3 fails


/lib/python3.11/site-packages/factryengine/scheduler/heuristic_solver/task_allocator.py:62, in TaskAllocator.allocate_task(self, resource_windows_dict, assignments, constraints, task_duration)
     60 # add constraints to allocated windows
     61 if constraints and assignments:
---> 62     constraints_matrix_trimmed = Matrix.trim_end(
     63         original_matrix=constraints_matrix, trim_matrix=solution_matrix
     64     )
     65     allocated_windows.update(
     66         self._get_resource_intervals(
     67             matrix=constraints_matrix_trimmed,
     68         )
     69     )
     71 return allocated_windows

/lib/python3.11/site-packages/factryengine/scheduler/heuristic_solver/matrix.py:62, in Matrix.trim_end(cls, original_matrix, trim_matrix)
     59 # Check if intervals are the same
     61 if not np.array_equal(new_intervals, trim_matrix.intervals):
---> 62     raise ValueError("All matrices must have the same intervals")
     64 return cls(
     65     resource_ids=original_matrix.resource_ids,
     66     intervals=new_intervals,
   (...)
     69     ],
     70 )

ValueError: All matrices must have the same intervals

```

Build Scheduler app models

we need these models to store the output of the scheduling algorithm, which has the following output:
image

They should all be add to the scheduler app.

Models Overview

  1. SchedulerRuns

    • id (AutoField): Primary key, automatically incremented.
    • run_time (DateTimeField): Records when the scheduling process was executed.
    • details (TextField): Stores a summary or details about the scheduling run, such as outcomes, performance metrics, etc.
  2. ResourceIntervals

    • id (AutoField): Primary key, automatically incremented.
    • resource_id (ForeignKey): Links to the Resource model.
    • task_id (ForeignKey): Links to the Task model, indicating the task to which the interval belongs.
    • interval_start (DateTimeField): The start time of the scheduled interval.
    • interval_end (DateTimeField): The end time of the scheduled interval.
  3. ResourceAllocations

    • id (AutoField): Primary key, automatically incremented.
    • task_id (ForeignKey): Links to the Task model.
    • resource_id (ForeignKey): Links to the Resource model, indicating the resource assigned to the task.
  4. Task (existing model)

    • planned_start (DateTimeField): Planned start time for the task.
    • planned_end (DateTimeField): Planned end time for the task.

pydantic error on getting started example

p311

EDIT:

concerns the example at https://factryflow.github.io/factryengine/#documentation

    task1 = Task(id=1, duration=3, priority=2, resources=[[resource]])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/korny/micromamba/envs/tofutime/lib/python3.11/site-packages/pydantic/main.py", line 171, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Task
  Value error, Either assignments or constraints must be set [type=value_error, input_value={'id': 1, 'duration': 3, ...iciency_multiplier=1)]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/value_error
``

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.