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

Complete_with_archetype won't complete embedded dictionary for usage component #48

Closed
da-ekchajzer opened this issue Jan 24, 2022 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@da-ekchajzer
Copy link
Collaborator

Problem

Complete_with_archetype won't complete workload data if workload exist but is not complete. It's an issue if I want to give a time per workload, but I don't have the power per load (case of cloud).

Example : since workload exist, the object will be used without replacing power

  "usage": {
    "hours_use_time": 1,
    "workload": {
     "10": {
        "time": 0.2,
      },
      "50": {
        "time": 0.3
      },
      "100": {
        "time":  0.5
      },
      "idle": {
        "time":  0
      }
    }
}

ERROR : hours_electrical_consumption += values["time"] * values["power"] * self.max_power KeyError: 'power'

Solution

complete_with_archetype for usage components should have a recursive way of treating attributes for usage only.

Additional context or elements

Such use case should be unit tested

@da-ekchajzer da-ekchajzer added help wanted Extra attention is needed bug Something isn't working functional and removed bug Something isn't working labels Jan 24, 2022
@benjaminlebigot benjaminlebigot self-assigned this Jan 25, 2022
@da-ekchajzer da-ekchajzer added bug Something isn't working and removed functional labels Jan 31, 2022
@da-ekchajzer
Copy link
Collaborator Author

Example of how the API should behave

INPUT

  "model":{
     "archetype": "dellR740"
  }
  "usage": {
    "hours_use_time": 1,
    "workload": {
     "10": {
        "time": 0.2,
      },
      "50": {
        "time": 0.3
      },
      "100": {
        "time":  0.5
      },
      "idle": {
        "time":  0
      }
    }
}

complete_with_archetype should set power from dell r740

INPUT

  "model":{
     "archetype": "dellR740"
  }
  "usage": {
    "max_power": 510,
    "hours_use_time": 1,
    "workload": {
     "10": {
        "time": 0.2,
        "power": 0.5118
      },
      "50": {
        "time": 0.3,
        "power": 0.7235
      },
      "100": {
        "time":  0.5,
        "power": 1.0
      },
      "idle": {
        "time":  0,
        "power": 0.3941
      }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants