rodrigo-arenas / pyworkforce

Standard tools for workforce management, queuing, scheduling, rostering and optimization problems.
https://pyworkforce.readthedocs.io
MIT License
75 stars 19 forks source link

banned_shifts #38

Closed evr194 closed 1 year ago

evr194 commented 1 year ago

I have a correct 'resources' list for which I have created 4 'banned_shifts' for 4 different resources. However, I am already getting the below error code for the first of these 4 resources. Ir seems logical that resource n° 11 is not in the list, since his shift is banned. So, why am I getting this error ? Whys is pyworkforce not just skipping this resource for the given shift and moves on to calculate the roster as intended ?

Traceback (most recent call last): File "C:\Users\euphr\PycharmProject\planning_tool\09_MinHoursRoster.py", line 150, in main() File "C:\Users\euphr\PycharmProject\planning_tool\09_MinHoursRoster.py", line 142, in main create_min_hours_roster_output(resources) File "C:\Users\euphr\PycharmProject\planning_tool\09_MinHoursRoster.py", line 82, in create_min_hours_roster_output roster_solution = roster_scheduler.solve() File "C:\Users\euphr\PycharmProject\planning_tool\venv\lib\site-packages\pyworkforce\rostering\binary_programming.py", line 150, in solve resource_idx = self.resources.index(ban['resource']) ValueError: 'resource_011@fed.com' is not in list

rodrigo-arenas commented 1 year ago

Hi @evr194 could you provide the code snippet that you are using? This way is simpler to reproduce this error and fix it if necessary

evr194 commented 1 year ago

Hello Rodriogo,

I suppose you are referring to the issue I posted two days ago. I must apologize : my post was premature. the resource I selected was part of a dataframe and I had selected the entire dataframe instead of just the 'resource' column. hence, I indicated myself the problem as already solved.

On the other hand, this afternoon, I posted a suggestion as on how to add a new tool. Text of that post is attached to this mail. I would really appreciate your help with this.

Regards,

Eric Van Roy

@.*** +32-473-483.475

[cid:e1cdf363-690b-463f-8028-b664fc714863] www.afri-terra.comhttp://www.afri-terra.com

a divison of

[cid:a1fc05d4-9063-419d-b4ed-7cae5b0d8959]

This email is confidential and intended only for the person or company indicated above. It may be legally privileged. If you have received this email in error, please let us know immediately and then delete it. Please do not copy or use it for any purpose or disclose its contents.

Ce message est confidentiel et destiné à la personne ou l'entité désignée ci-dessus. Il peut être protégé par le secret professionnel. Si vous avez reçu ce message par erreur, merci de nous en informer immédiatement et de détruire ce message.


Van: Rodrigo Arenas @.> Verzonden: woensdag 1 februari 2023 17:32 Aan: rodrigo-arenas/pyworkforce @.> CC: Eric Van Roy @.>; Mention @.> Onderwerp: Re: [rodrigo-arenas/pyworkforce] banned_shifts (Issue #38)

Hi @evr194https://github.com/evr194 could you provide the code snippet that you are using? This way is simpler to reproduce this error and fix it if necessary

— Reply to this email directly, view it on GitHubhttps://github.com/rodrigo-arenas/pyworkforce/issues/38#issuecomment-1412354498, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5SMQDGJF4JYKVI5P3HHNZDWVKFZDANCNFSM6AAAAAAUMIUIJM. You are receiving this because you were mentioned.Message ID: @.***>

rodrigo-arenas commented 1 year ago

Thanks Eric for the update, I'm closing this issue, I'll try to check the other request

Greetings