cloudpss 4.5.21__tar.gz → 4.5.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloudpss-4.5.21 → cloudpss-4.5.23}/PKG-INFO +1 -1
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/messageStreamReceiver.py +4 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/model.py +29 -5
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/topology.py +8 -1
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/IESLabPlanResult.py +1 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/graphqlUtil.py +3 -1
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/httprequests.py +2 -2
 - cloudpss-4.5.23/cloudpss/version.py +1 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss.egg-info/PKG-INFO +1 -1
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-topology.py +6 -4
 - cloudpss-4.5.23/test/test-topology1.py +37 -0
 - cloudpss-4.5.23/test/testb.py +34 -0
 - cloudpss-4.5.21/cloudpss/version.py +0 -1
 - cloudpss-4.5.21/test/test-topology1.py +0 -31
 - cloudpss-4.5.21/test/testb.py +0 -16
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/README.md +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/job/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/job/job.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/job/messageStreamReceiver.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/job/messageStreamSender.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/model/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/model/model.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/model/revision.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/model/topology.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/utils/AsyncIterable.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/utils/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/asyncio/utils/httpAsyncRequest.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/dataManageModel.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/dslab.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/files/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/files/curveData.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/files/files.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/dslab/financialAnalysisModel.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/function/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/function/function.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/function/functionExecution.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/function/job.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/DataManageModel.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/EvaluationModel.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/IESLabOpt.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/IESLabPlan.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/IESLabSimulation.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/PlanModel.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/ieslab/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/TemplateCompiler.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/TemplateManager.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/job.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/jobReceiver.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/messageStreamSender.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/EMTResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/IESLabSimulationResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/IESLabTypicalDayResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/IESResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/PowerFlowResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/job/result/result.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/implements/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/implements/component.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/implements/diagram.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/implements/implement.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/jobDefinitions.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/model/revision.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/project/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/project/project.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/DSLabResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/IESLabEvaluationResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/IESLabTypicalDayResult.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/MessageStreamReceiver.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/receiver.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/result.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/runner.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/storage.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/runner/transform.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/IO.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/__init__.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/dataEncoder.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/matlab.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/parseDebugArgs.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/utils/yamlLoader.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss/verify.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss.egg-info/SOURCES.txt +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss.egg-info/dependency_links.txt +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss.egg-info/requires.txt +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/cloudpss.egg-info/top_level.txt +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/setup.cfg +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/setup.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-async.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-async2.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-async3.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-plot.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-plot1.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-sdk.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-sdk1.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-snapshot.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test-yield.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test11.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test12.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test2.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test7950.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testAsync.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testEvent.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testRt-test.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testRt.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testRt2.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testSend.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test_TCP.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test_in_new_web_1.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test_modepower_ampratio(3).py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test_ws.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test_ws2.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/test_ws3.py +0 -0
 - {cloudpss-4.5.21 → cloudpss-4.5.23}/test/testkey.py +0 -0
 
| 
         @@ -93,6 +93,10 @@ class MessageStreamReceiver(JobReceiver): 
     | 
|
| 
       93 
93 
     | 
    
         | 
| 
       94 
94 
     | 
    
         
             
                def __on_error(self,  *args, **kwargs):
         
     | 
| 
       95 
95 
     | 
    
         
             
                    logging.debug("MessageStreamReceiver error")
         
     | 
| 
      
 96 
     | 
    
         
            +
                    err = args[1] if len(args)>1 else None
         
     | 
| 
      
 97 
     | 
    
         
            +
                    if isinstance(err, websocket.WebSocketConnectionClosedException):
         
     | 
| 
      
 98 
     | 
    
         
            +
                        self.close(args[0])
         
     | 
| 
      
 99 
     | 
    
         
            +
                        return
         
     | 
| 
       96 
100 
     | 
    
         
             
                    msg = {
         
     | 
| 
       97 
101 
     | 
    
         
             
                        "type": "log",
         
     | 
| 
       98 
102 
     | 
    
         
             
                        "verb": "create",
         
     | 
| 
         @@ -487,6 +487,20 @@ class Model(object): 
     | 
|
| 
       487 
487 
     | 
    
         | 
| 
       488 
488 
     | 
    
         
             
                    revision = ModelRevision.create(model.revision, model.revision.hash)
         
     | 
| 
       489 
489 
     | 
    
         | 
| 
      
 490 
     | 
    
         
            +
                    # 使用默认权限对象,但如果model的permissions字段中有相关权限值就使用model中的数值
         
     | 
| 
      
 491 
     | 
    
         
            +
                    default_permissions = {
         
     | 
| 
      
 492 
     | 
    
         
            +
                        "moderator": 98367,
         
     | 
| 
      
 493 
     | 
    
         
            +
                        "member": 65551,
         
     | 
| 
      
 494 
     | 
    
         
            +
                        "everyone": 0
         
     | 
| 
      
 495 
     | 
    
         
            +
                    }
         
     | 
| 
      
 496 
     | 
    
         
            +
                    
         
     | 
| 
      
 497 
     | 
    
         
            +
                    # 如果model有permissions字段,则合并权限值
         
     | 
| 
      
 498 
     | 
    
         
            +
                    model_permissions = getattr(model, 'permissions', {})
         
     | 
| 
      
 499 
     | 
    
         
            +
                    if isinstance(model_permissions, dict):
         
     | 
| 
      
 500 
     | 
    
         
            +
                        permissions = {**default_permissions, **model_permissions}
         
     | 
| 
      
 501 
     | 
    
         
            +
                    else:
         
     | 
| 
      
 502 
     | 
    
         
            +
                        permissions = default_permissions
         
     | 
| 
      
 503 
     | 
    
         
            +
             
     | 
| 
       490 
504 
     | 
    
         
             
                    return graphql_request(
         
     | 
| 
       491 
505 
     | 
    
         
             
                        Model.__create_model,
         
     | 
| 
       492 
506 
     | 
    
         
             
                        {
         
     | 
| 
         @@ -499,11 +513,7 @@ class Model(object): 
     | 
|
| 
       499 
513 
     | 
    
         
             
                                "name": model.name,
         
     | 
| 
       500 
514 
     | 
    
         
             
                                "description": model.description,
         
     | 
| 
       501 
515 
     | 
    
         
             
                                "tags": model.tags,
         
     | 
| 
       502 
     | 
    
         
            -
                                "permissions":  
     | 
| 
       503 
     | 
    
         
            -
                                   "moderator": 98367,
         
     | 
| 
       504 
     | 
    
         
            -
                                    "member": 65551,
         
     | 
| 
       505 
     | 
    
         
            -
                                    "everyone": 0
         
     | 
| 
       506 
     | 
    
         
            -
                                },
         
     | 
| 
      
 516 
     | 
    
         
            +
                                "permissions": permissions,
         
     | 
| 
       507 
517 
     | 
    
         
             
                            }
         
     | 
| 
       508 
518 
     | 
    
         
             
                        },
         
     | 
| 
       509 
519 
     | 
    
         
             
                        **kwargs
         
     | 
| 
         @@ -543,6 +553,20 @@ class Model(object): 
     | 
|
| 
       543 
553 
     | 
    
         
             
                    if xVersion==3:
         
     | 
| 
       544 
554 
     | 
    
         
             
                        tags=model.tags
         
     | 
| 
       545 
555 
     | 
    
         | 
| 
      
 556 
     | 
    
         
            +
                    # 使用默认权限对象,但如果model的permissions字段中有相关权限值就使用model中的数值
         
     | 
| 
      
 557 
     | 
    
         
            +
                    default_permissions = {
         
     | 
| 
      
 558 
     | 
    
         
            +
                        "moderator": 98367,
         
     | 
| 
      
 559 
     | 
    
         
            +
                        "member": 65551,
         
     | 
| 
      
 560 
     | 
    
         
            +
                        "everyone": 0
         
     | 
| 
      
 561 
     | 
    
         
            +
                    }
         
     | 
| 
      
 562 
     | 
    
         
            +
                    
         
     | 
| 
      
 563 
     | 
    
         
            +
                    # 如果model有permissions字段,则合并权限值
         
     | 
| 
      
 564 
     | 
    
         
            +
                    model_permissions = getattr(model, 'permissions', {})
         
     | 
| 
      
 565 
     | 
    
         
            +
                    if isinstance(model_permissions, dict):
         
     | 
| 
      
 566 
     | 
    
         
            +
                        permissions = {**default_permissions, **model_permissions}
         
     | 
| 
      
 567 
     | 
    
         
            +
                    else:
         
     | 
| 
      
 568 
     | 
    
         
            +
                        permissions = default_permissions
         
     | 
| 
      
 569 
     | 
    
         
            +
             
     | 
| 
       546 
570 
     | 
    
         
             
                    r= graphql_request(
         
     | 
| 
       547 
571 
     | 
    
         
             
                        Model.__update_model, {
         
     | 
| 
       548 
572 
     | 
    
         
             
                            'a': {
         
     | 
| 
         @@ -56,7 +56,7 @@ class ModelTopology(): 
     | 
|
| 
       56 
56 
     | 
    
         
             
                    f.close()
         
     | 
| 
       57 
57 
     | 
    
         | 
| 
       58 
58 
     | 
    
         
             
                @staticmethod
         
     | 
| 
       59 
     | 
    
         
            -
                def fetch(hash, implementType, config, maximumDepth=None, **kwargs):
         
     | 
| 
      
 59 
     | 
    
         
            +
                def fetch(hash, implementType, config, maximumDepth=None,topology=None, **kwargs):
         
     | 
| 
       60 
60 
     | 
    
         
             
                    """
         
     | 
| 
       61 
61 
     | 
    
         
             
                        获取拓扑
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
         @@ -86,11 +86,18 @@ class ModelTopology(): 
     | 
|
| 
       86 
86 
     | 
    
         
             
                            ports
         
     | 
| 
       87 
87 
     | 
    
         
             
                        """
         
     | 
| 
       88 
88 
     | 
    
         
             
                        del kwargs['ports']
         
     | 
| 
      
 89 
     | 
    
         
            +
                    
         
     | 
| 
      
 90 
     | 
    
         
            +
                    if topology is not None:
         
     | 
| 
      
 91 
     | 
    
         
            +
                        if not isinstance(topology, ModelTopology):
         
     | 
| 
      
 92 
     | 
    
         
            +
                            raise TypeError("topology must be an instance of ModelTopology")
         
     | 
| 
      
 93 
     | 
    
         
            +
                        variables['a']['topology'] = topology.toJSON()
         
     | 
| 
      
 94 
     | 
    
         
            +
                        
         
     | 
| 
       89 
95 
     | 
    
         
             
                    query = ModelTopology.__modelTopologyQuery + ModelTopology.__ReqParam + "}}"
         
     | 
| 
       90 
96 
     | 
    
         | 
| 
       91 
97 
     | 
    
         | 
| 
       92 
98 
     | 
    
         
             
                    data = graphql_request(query, variables, **kwargs)
         
     | 
| 
       93 
99 
     | 
    
         
             
                    if 'errors' in data:
         
     | 
| 
      
 100 
     | 
    
         
            +
                        print(data['errors'])
         
     | 
| 
       94 
101 
     | 
    
         
             
                        raise Exception(data['errors'][0]['message'])
         
     | 
| 
       95 
102 
     | 
    
         | 
| 
       96 
103 
     | 
    
         
             
                    return ModelTopology(data['data']['modelTopology'])
         
     | 
| 
         @@ -1,11 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # coding=UTF-8
         
     | 
| 
       2 
2 
     | 
    
         
             
            import json
         
     | 
| 
       3 
3 
     | 
    
         
             
            from cloudpss.utils import request
         
     | 
| 
      
 4 
     | 
    
         
            +
            from cloudpss.utils.IO import IO
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
       5 
6 
     | 
    
         | 
| 
       6 
7 
     | 
    
         
             
            def graphql_request(query, variables=None, baseUrl=None,token=None,**kwargs):
         
     | 
| 
       7 
8 
     | 
    
         
             
                payload = {'query': query, 'variables': variables}
         
     | 
| 
       8 
9 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
      
 10 
     | 
    
         
            +
                
         
     | 
| 
      
 11 
     | 
    
         
            +
                r = request('POST', 'graphql', data=IO.serialize(payload,'json'),baseUrl=baseUrl,token=token, **kwargs)
         
     | 
| 
       10 
12 
     | 
    
         | 
| 
       11 
13 
     | 
    
         
             
                return json.loads(r.text)
         
     | 
| 
         @@ -18,8 +18,8 @@ def request(method, uri, baseUrl=None, params={}, token=None, **kwargs): 
     | 
|
| 
       18 
18 
     | 
    
         
             
                if token:
         
     | 
| 
       19 
19 
     | 
    
         
             
                    headers = {
         
     | 
| 
       20 
20 
     | 
    
         
             
                        'Authorization': 'Bearer ' + token,
         
     | 
| 
       21 
     | 
    
         
            -
                        'Content-Type': 'application/json; charset=utf-8',
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
                        'Content-Type': 'application/json+gzip; charset=utf-8',
         
     | 
| 
      
 22 
     | 
    
         
            +
                        "User-Agent": "cloudpss-sdk-python/" + __version__
         
     | 
| 
       23 
23 
     | 
    
         
             
                    }
         
     | 
| 
       24 
24 
     | 
    
         
             
                else:
         
     | 
| 
       25 
25 
     | 
    
         
             
                    raise Exception('token undefined')
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            __version__ = '4.5.23'
         
     | 
| 
         @@ -8,14 +8,16 @@ import pandas as pd 
     | 
|
| 
       8 
8 
     | 
    
         
             
            import json
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
            if __name__ == '__main__':
         
     | 
| 
       11 
     | 
    
         
            -
                os.environ['CLOUDPSS_API_URL'] = 'http:// 
     | 
| 
      
 11 
     | 
    
         
            +
                os.environ['CLOUDPSS_API_URL'] = 'http://cloudpss-nb2030.local.ddns.cloudpss.net/'
         
     | 
| 
       12 
12 
     | 
    
         
             
                print('CLOUDPSS connected')
         
     | 
| 
       13 
13 
     | 
    
         
             
                cloudpss.setToken(
         
     | 
| 
       14 
14 
     | 
    
         
             
                    'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTEsInVzZXJuYW1lIjoiemhvdXFpYW5nIiwic2NvcGVzIjpbImJyb3dzZXIiXSwicm9sZXMiOlsiKiJdLCJ0eXBlIjoiYnJvd3NlciIsImV4cCI6MTcyNTUyNjkxNywiaWF0IjoxNzIyODQ4NTE3fQ.WjTa_hQg6nhtXjpNY7pcgGHgjv9NE1YDDPepL5Xjg_Xms-HT9LUw5MBngBLvlXQtajnwAOkNVnVv49hxHcOzRQ')
         
     | 
| 
       15 
15 
     | 
    
         
             
                print('Token done')
         
     | 
| 
       16 
     | 
    
         
            -
                project = cloudpss.Model.fetch('model/ 
     | 
| 
       17 
     | 
    
         
            -
                print(project.revision.hash)
         
     | 
| 
       18 
     | 
    
         
            -
                t = time.time()
         
     | 
| 
      
 16 
     | 
    
         
            +
                project = cloudpss.Model.fetch('model/admin/PMSG_Model_12MW_AVM_sungrow_pscad')
         
     | 
| 
      
 17 
     | 
    
         
            +
                # print(project.revision.hash)
         
     | 
| 
      
 18 
     | 
    
         
            +
                # t = time.time()
         
     | 
| 
      
 19 
     | 
    
         
            +
                
         
     | 
| 
      
 20 
     | 
    
         
            +
                topology = project.fetchTopology(config={'args':{}},maximumDepth=10)
         
     | 
| 
       19 
21 
     | 
    
         
             
                # topology = cloudpss.ModelTopology.fetch("hlbBPYIyQHWzgPxdjp9lV9a92twyxA2zETzrqz4Q0fou7mfOemX-pr9OfO9eUfq4","emtp",{'args':{}})
         
     | 
| 
       20 
22 
     | 
    
         
             
                # topology = cloudpss.ModelTopology.fetch("JwHbZdjco9eC0nZw3fY7Iz9rqsQ4HFGJObiBW3bFuYLPCd0Vqb2vb8zNY28D1AXV","emtp",{'args':{}})
         
     | 
| 
       21 
23 
     | 
    
         
             
                # print(time.time()-t)
         
     | 
| 
         @@ -0,0 +1,37 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            import time
         
     | 
| 
      
 3 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 4 
     | 
    
         
            +
            import os
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            sys.path.append(os.path.join(os.path.dirname(__file__), '..\\'))
         
     | 
| 
      
 7 
     | 
    
         
            +
            import cloudpss
         
     | 
| 
      
 8 
     | 
    
         
            +
            import time
         
     | 
| 
      
 9 
     | 
    
         
            +
            import json
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            if __name__ == '__main__':
         
     | 
| 
      
 12 
     | 
    
         
            +
                os.environ['CLOUDPSS_API_URL'] = 'http://10.101.10.45/'
         
     | 
| 
      
 13 
     | 
    
         
            +
                print('CLOUDPSS connected')
         
     | 
| 
      
 14 
     | 
    
         
            +
                cloudpss.setToken(
         
     | 
| 
      
 15 
     | 
    
         
            +
                    'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsInNjb3BlcyI6WyJtb2RlbDo5ODM2NyIsImZ1bmN0aW9uOjk4MzY3IiwiYXBwbGljYXRpb246MzI4MzEiXSwicm9sZXMiOlsiYWRtaW4iXSwidHlwZSI6ImFwcGx5IiwiZXhwIjoxNzY2MzA3MzU1LCJub3RlIjoiYWEiLCJpYXQiOjE3NTA3NTUzNTV9.iYh3otDGy-f7dKyIUd8xpnEuwVuRDfmBVsI112XeCZBe7sZLdyBb6a4XqOd8AoyTzFcpLj7rF1PQcT4mhEf6kA')
         
     | 
| 
      
 16 
     | 
    
         
            +
                print('Token done')
         
     | 
| 
      
 17 
     | 
    
         
            +
                project = cloudpss.Model.fetch('model/admin/3d72939f-6287-456a-92ea-8b66aab0ec65')
         
     | 
| 
      
 18 
     | 
    
         
            +
                # topology = cloudpss.ModelTopology.fetch("-xrS3SewFhpVYKBtIXLk-XDLCQRQnUmlIbXS3s4sdPUkPKeAMhXHjRgZD1JPjPfQ","emtp",{'args':{}})
         
     | 
| 
      
 19 
     | 
    
         
            +
                topology= project.fetchTopology(implementType='emtp',config={'args':{}},maximumDepth=50)
         
     | 
| 
      
 20 
     | 
    
         
            +
                print(topology.components)
         
     | 
| 
      
 21 
     | 
    
         
            +
                
         
     | 
| 
      
 22 
     | 
    
         
            +
                
         
     | 
| 
      
 23 
     | 
    
         
            +
                topology.dump(topology,'testTopology.json',indent=2)
         
     | 
| 
      
 24 
     | 
    
         
            +
                
         
     | 
| 
      
 25 
     | 
    
         
            +
                
         
     | 
| 
      
 26 
     | 
    
         
            +
                # topology2 = cloudpss.ModelTopology.fetch('', 'emtp', {'args': {}}, maximumDepth=5, topology=topology)
         
     | 
| 
      
 27 
     | 
    
         
            +
                
         
     | 
| 
      
 28 
     | 
    
         
            +
                
         
     | 
| 
      
 29 
     | 
    
         
            +
                # print(topology2.components)
         
     | 
| 
      
 30 
     | 
    
         
            +
                # topology2.dump(topology2,'testTopology2.json',indent=2)
         
     | 
| 
      
 31 
     | 
    
         
            +
                
         
     | 
| 
      
 32 
     | 
    
         
            +
                
         
     | 
| 
      
 33 
     | 
    
         
            +
                # topology3= project.fetchTopology(config={'args':{}},maximumDepth=5)
         
     | 
| 
      
 34 
     | 
    
         
            +
                # print(topology3.components)
         
     | 
| 
      
 35 
     | 
    
         
            +
                
         
     | 
| 
      
 36 
     | 
    
         
            +
                
         
     | 
| 
      
 37 
     | 
    
         
            +
                # topology3.dump(topology3,'testTopology3.json',indent=2)
         
     | 
| 
         @@ -0,0 +1,34 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import sys,os
         
     | 
| 
      
 2 
     | 
    
         
            +
            sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
         
     | 
| 
      
 3 
     | 
    
         
            +
            import cloudpss
         
     | 
| 
      
 4 
     | 
    
         
            +
            import json
         
     | 
| 
      
 5 
     | 
    
         
            +
            import time
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            if __name__ == '__main__':
         
     | 
| 
      
 8 
     | 
    
         
            +
                
         
     | 
| 
      
 9 
     | 
    
         
            +
                  cloudpss.setToken('eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTE1NTcsInVzZXJuYW1lIjoiYmFuZ2ppbGVnYW9sZWdhbyIsInNjb3BlcyI6WyJtb2RlbDo5ODM2NyIsImZ1bmN0aW9uOjk4MzY3IiwiYXBwbGljYXRpb246MzI4MzEiXSwicm9sZXMiOlsiYmFuZ2ppbGVnYW9sZWdhbyJdLCJ0eXBlIjoiYXBwbHkiLCJleHAiOjE3OTExODg2OTEsIm5vdGUiOiIxMjMiLCJpYXQiOjE3NjAwODQ2OTF9.RoHSICdh_6ygNuXde166K5rDujPReskYdgCcJTfTrdsXlQ4x6hleVCRedpvYbDzZZYwrwZ8XG5FT8ops3BLICg')
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                  os.environ['CLOUDPSS_API_URL'] = 'https://cloudpss.net/'
         
     | 
| 
      
 12 
     | 
    
         
            +
                  
         
     | 
| 
      
 13 
     | 
    
         
            +
                  # 获取指定 rid 的项目
         
     | 
| 
      
 14 
     | 
    
         
            +
                  model = cloudpss.Model.fetch('model/songyankan/3_Gen_9_Bus')
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                  # 修改 Gen2 发电机有功功率
         
     | 
| 
      
 17 
     | 
    
         
            +
                  comp = model.getComponentByKey('canvas_0_757')
         
     | 
| 
      
 18 
     | 
    
         
            +
                  print(comp.args)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  comp.args['pf_P'] = '180'
         
     | 
| 
      
 20 
     | 
    
         
            +
                  
         
     | 
| 
      
 21 
     | 
    
         
            +
                  # 启动计算任务
         
     | 
| 
      
 22 
     | 
    
         
            +
                  config = model.configs[0]  # 若未设置,则默认用model的第一个config(参数方案)
         
     | 
| 
      
 23 
     | 
    
         
            +
                  job = model.jobs[0]  # 若未设置,则默认用model的第一个job(计算方案)
         
     | 
| 
      
 24 
     | 
    
         
            +
                  runner = model.run(job,config)
         
     | 
| 
      
 25 
     | 
    
         
            +
                  while not runner.status():
         
     | 
| 
      
 26 
     | 
    
         
            +
                     logs = runner.result.getLogs()
         
     | 
| 
      
 27 
     | 
    
         
            +
                     for log in logs:
         
     | 
| 
      
 28 
     | 
    
         
            +
                           print(log)
         
     | 
| 
      
 29 
     | 
    
         
            +
                     time.sleep(1)
         
     | 
| 
      
 30 
     | 
    
         
            +
                  print('end')
         
     | 
| 
      
 31 
     | 
    
         
            +
                  
         
     | 
| 
      
 32 
     | 
    
         
            +
                  # 打印结果
         
     | 
| 
      
 33 
     | 
    
         
            +
                  print(runner.result.getBranches())
         
     | 
| 
      
 34 
     | 
    
         
            +
                  print(runner.result.getBuses())
         
     | 
| 
         @@ -1 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            __version__ = '4.5.21'
         
     | 
| 
         @@ -1,31 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
            import time
         
     | 
| 
       3 
     | 
    
         
            -
            import sys
         
     | 
| 
       4 
     | 
    
         
            -
            import os
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            sys.path.append(os.path.join(os.path.dirname(__file__), '..\\'))
         
     | 
| 
       7 
     | 
    
         
            -
            import cloudpss
         
     | 
| 
       8 
     | 
    
         
            -
            import time
         
     | 
| 
       9 
     | 
    
         
            -
            import numpy as np
         
     | 
| 
       10 
     | 
    
         
            -
            import pandas as pd
         
     | 
| 
       11 
     | 
    
         
            -
            import json
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            if __name__ == '__main__':
         
     | 
| 
       14 
     | 
    
         
            -
                os.environ['CLOUDPSS_API_URL'] = 'http://10.101.10.45/'
         
     | 
| 
       15 
     | 
    
         
            -
                print('CLOUDPSS connected')
         
     | 
| 
       16 
     | 
    
         
            -
                cloudpss.setToken(
         
     | 
| 
       17 
     | 
    
         
            -
                    'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsInNjb3BlcyI6WyJtb2RlbDo5ODMzNSIsImZ1bmN0aW9uOjk4MzM1IiwiYXBwbGljYXRpb246OTgzMzUiXSwicm9sZXMiOlsiYWRtaW4iXSwidHlwZSI6ImFwcGx5IiwiZXhwIjoxNzI0NTU3MDIzLCJub3RlIjoiYSIsImlhdCI6MTY5MzQ1MzAyM30._Xuyo62ESKLcIAFeNdnfBM44yPiiXli9OPKvXDzL2rPV4J1_qsGZP--bsS1tXAVy-x8ooUIIAAG1yhwmZuk7-Q')
         
     | 
| 
       18 
     | 
    
         
            -
                print('Token done')
         
     | 
| 
       19 
     | 
    
         
            -
                project = cloudpss.Model.fetch('model/admin/asdfsadd')
         
     | 
| 
       20 
     | 
    
         
            -
                # topology = cloudpss.ModelTopology.fetch("-xrS3SewFhpVYKBtIXLk-XDLCQRQnUmlIbXS3s4sdPUkPKeAMhXHjRgZD1JPjPfQ","emtp",{'args':{}})
         
     | 
| 
       21 
     | 
    
         
            -
                topology= project.fetchTopology(config={'args':{}},maximumDepth=50)
         
     | 
| 
       22 
     | 
    
         
            -
                print(topology.components)
         
     | 
| 
       23 
     | 
    
         
            -
                # topology.dump(topology,'test.json')
         
     | 
| 
       24 
     | 
    
         
            -
                
         
     | 
| 
       25 
     | 
    
         
            -
                
         
     | 
| 
       26 
     | 
    
         
            -
                # # topology= project.fetchTopology(config={'args':{}})
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                # topology.dump(topology,'test.json')
         
     | 
| 
       29 
     | 
    
         
            -
                
         
     | 
| 
       30 
     | 
    
         
            -
                
         
     | 
| 
       31 
     | 
    
         
            -
                
         
     | 
    
        cloudpss-4.5.21/test/testb.py
    DELETED
    
    
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |