-
Notifications
You must be signed in to change notification settings - Fork 33
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
Skip appliance if func_time==0 or rand_time==0 #116
Skip appliance if func_time==0 or rand_time==0 #116
Conversation
To be able to checkout locally @JW-Kraft branch I did
We only have read acces unless @JW-Kraft grant us write access like described in the docs |
|
||
# Generate test user and appliance | ||
user = User(user_name="Test User", num_users=1) | ||
appliance = user.add_appliance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normally you could simply create an appliance without user or usecase and call generate_load_profile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting a fix for this @JW-Kraft !
@FLomb - are you ok with merging without having the testpypi test being able to run? (the problem there is credentials of test-pypi) |
I'm not following, why do we have credentials issues with test-pypi? |
@Bachibouzouk the issue is very similar to https://github.com/orgs/community/discussions/57621 |
40c03bb
to
0c65148
Compare
@mohammadamint - can it be that because the PR is based form a fork, the permissions are not sufficient to run test-pypi deploy test? Because I did merge your fix and update the PR |
This seems to be the issue. A solution could be to instead of triggering the workflow on pull requests, trigger it on tag or release creation events. Do you see any problem with this solution @Bachibouzouk ? |
No I think what you propose make sense |
There is one problem, and that is that the workflow wont be triggered on PR but on push event. I would ignore the issue for now, and proceed with this PR, if urgent, so meanwhile I can seek for a better solution. |
It looks like all tests pass now; does this mean you have implemented a solution to the test PyPi issue? |
They all passed because their number reduced from 3 to 2 tests, after the changes introduced by @mohammadamint and approved by me. I am not sure I got why it did not work, does it only work when I push to this PR now? |
indeed. I would however, switch back to previous version after finalizing this PR, until I can find a better solution, hopefully by the end of the week! |
Fix #114
Implemented fix as proposed in issue 114:
rand_time!=0
as condition in the while loop of functionAppliance.generate_load_profile
. This way, appliances are skipped when therand_time
is calculated to be 0, which can happen whentime_fraction_random_variability
is set to 1.One small addition:
Appliance.rand_total_time_of_use
can throw error.