- 
                Notifications
    You must be signed in to change notification settings 
- Fork 20
          Replace the internal microgrid API client with frequenz-client-microgrid
          #892
        
          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
          
     Merged
      
      
    Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    We'll start to use the new external microgrid client instead of the internal one. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
The `Connection` type in the external microgrid API is a dataclass instead of a tuple, so we need to convert it when a tuple is expected. Signed-off-by: Leandro Lucarella <[email protected]>
In the tests we are sometimes mocking the client, so we need to use the client `Fuse` type instead of our internal `Fuse` type (that uses quantities). Signed-off-by: Leandro Lucarella <[email protected]>
To avoid circular dependencies, it is always better to import symbols from the leaf module internally. Signed-off-by: Leandro Lucarella <[email protected]>
Since now we have an internal `Fuse` type that uses quantities to avoid bugs, we need to make sure to properly convert between the client's `Fuse` type and the internal one. There is also actually a bug in the old code, as the conversion to `Current` never happened. This was never caught by `mypy` because we were using the `**args` syntax to create the object, so there is no type checking of the arguments, so a bad `Fuse` was being created, with a `float` `max_current` instead of using `Current`. We now make sure the conversion is done appropriately. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Since we are now using an external microgrid client, it is better to mock the location more shallowly, avoiding any timezone lookups completely. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
              
                    shsms
  
              
              approved these changes
              
                  
                    Mar 11, 2024 
                  
              
              
            
            
| This looks good, I will take it in now, so that I can make progress on the channel update. | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    part:actor
  Affects an actor ot the actors utilities (decorator, etc.) 
  
    part:data-pipeline
  Affects the data pipeline 
  
    part:docs
  Affects the documentation 
  
    part:microgrid
  Affects the interactions with the microgrid 
  
    part:tests
  Affects the unit, integration and performance (benchmarks) tests 
  
    part:tooling
  Affects the development tooling (CI, deployment, dependency management, etc.) 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Unfortunately we can't remove the direct dependency on
frequenz-api-microgridyet because some code is still using the raw protobuf structures, as there are no wrappers for them yet (neither in the internal code nor infrequenz-client-microgrid, which is based on the SDK code).Fixes #853.