prisma-api 0.3.1__tar.gz → 0.3.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prisma_api
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: A package for interacting with PrISMa Platform APIs. PrISMa is a holistic system for numerical synthesis and assessment of Metal-Organic Frameworks and their applications, for Direct Air Capture of CO2. For more information, see: https://prisma.hw.ac.uk.
5
5
  Author-email: RCCS-CaptureTeam <team@prisma-platform.org>
6
6
  License: GNUv3
@@ -27,7 +27,6 @@ This package provides:
27
27
  - legacy v1 wrappers on the main `api` object
28
28
  - a larger v2 REST client on `api.v2`
29
29
  - local config-based API-key management
30
- - optional local development routing via `api.update_dev_mode(True)`
31
30
 
32
31
  PrISMa is a platform for numerical synthesis and assessment of metal-organic frameworks and related carbon-capture workflows.
33
32
 
@@ -39,22 +38,6 @@ PrISMa is a platform for numerical synthesis and assessment of metal-organic fra
39
38
  pip install prisma_api
40
39
  ```
41
40
 
42
- ### From source
43
-
44
- ```bash
45
- git clone https://github.com/RCCS-CaptureTeam/prisma_api.git
46
- cd prisma_api
47
- pip install .
48
- ```
49
-
50
- ### Development install
51
-
52
- ```bash
53
- git clone https://github.com/RCCS-CaptureTeam/prisma_api.git
54
- cd prisma_api
55
- pip install -e ".[dev]"
56
- ```
57
-
58
41
  ### Requirements
59
42
 
60
43
  - Python 3.10+
@@ -74,6 +57,12 @@ api = prisma_api.init()
74
57
 
75
58
  On first use, the package creates a config file and prompts for an API key.
76
59
 
60
+ ### Upgrades
61
+
62
+ ```python
63
+ pip install --upgrade prisma_api
64
+ ```
65
+
77
66
  ### Find the config path
78
67
 
79
68
  ```python
@@ -127,24 +116,16 @@ materials_df = api.v2.list_materials(name="ABEX")
127
116
  print(materials_df.head())
128
117
  ```
129
118
 
130
- ### Dev mode
119
+ ### Flowsheets
131
120
 
132
121
  ```python
133
122
  import prisma_api
134
123
 
135
- api = prisma_api.init()
136
- api.update_dev_mode(True)
137
124
  api = prisma_api.init()
138
125
 
139
126
  flowsheet = api.v2.get_flowsheet(name="dac_min")
140
127
  ```
141
128
 
142
- Disable dev mode the same way:
143
-
144
- ```python
145
- api.update_dev_mode(False)
146
- api = prisma_api.init()
147
- ```
148
129
 
149
130
  ## Return formats
150
131
 
@@ -7,7 +7,6 @@ This package provides:
7
7
  - legacy v1 wrappers on the main `api` object
8
8
  - a larger v2 REST client on `api.v2`
9
9
  - local config-based API-key management
10
- - optional local development routing via `api.update_dev_mode(True)`
11
10
 
12
11
  PrISMa is a platform for numerical synthesis and assessment of metal-organic frameworks and related carbon-capture workflows.
13
12
 
@@ -19,22 +18,6 @@ PrISMa is a platform for numerical synthesis and assessment of metal-organic fra
19
18
  pip install prisma_api
20
19
  ```
21
20
 
22
- ### From source
23
-
24
- ```bash
25
- git clone https://github.com/RCCS-CaptureTeam/prisma_api.git
26
- cd prisma_api
27
- pip install .
28
- ```
29
-
30
- ### Development install
31
-
32
- ```bash
33
- git clone https://github.com/RCCS-CaptureTeam/prisma_api.git
34
- cd prisma_api
35
- pip install -e ".[dev]"
36
- ```
37
-
38
21
  ### Requirements
39
22
 
40
23
  - Python 3.10+
@@ -54,6 +37,12 @@ api = prisma_api.init()
54
37
 
55
38
  On first use, the package creates a config file and prompts for an API key.
56
39
 
40
+ ### Upgrades
41
+
42
+ ```python
43
+ pip install --upgrade prisma_api
44
+ ```
45
+
57
46
  ### Find the config path
58
47
 
59
48
  ```python
@@ -107,24 +96,16 @@ materials_df = api.v2.list_materials(name="ABEX")
107
96
  print(materials_df.head())
108
97
  ```
109
98
 
110
- ### Dev mode
99
+ ### Flowsheets
111
100
 
112
101
  ```python
113
102
  import prisma_api
114
103
 
115
- api = prisma_api.init()
116
- api.update_dev_mode(True)
117
104
  api = prisma_api.init()
118
105
 
119
106
  flowsheet = api.v2.get_flowsheet(name="dac_min")
120
107
  ```
121
108
 
122
- Disable dev mode the same way:
123
-
124
- ```python
125
- api.update_dev_mode(False)
126
- api = prisma_api.init()
127
- ```
128
109
 
129
110
  ## Return formats
130
111
 
@@ -1,4 +1,4 @@
1
- __version__ = "0.3.1"
1
+ __version__ = "0.3.3"
2
2
 
3
3
 
4
4
  from prisma_api.prisma_api import prisma_api as init # Main prisma_api class for initialisation
@@ -132,6 +132,14 @@ class PrismaAPIv2:
132
132
  """
133
133
  return self._get(f"/flowsheets/{name}/")
134
134
 
135
+ def get_flowsheet_bundle(self) -> dict:
136
+ """
137
+ GET /api/v2/flowsheets/dac_min/bundle/
138
+
139
+ Returns the bundled flowsheet payload for the dac_min object.
140
+ """
141
+ return self._get("/flowsheets/dac_min/bundle/")
142
+
135
143
  # ── Catalog ───────────────────────────────────────────────────────────────
136
144
 
137
145
  def list_materials(self, name: str | None = None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prisma_api
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: A package for interacting with PrISMa Platform APIs. PrISMa is a holistic system for numerical synthesis and assessment of Metal-Organic Frameworks and their applications, for Direct Air Capture of CO2. For more information, see: https://prisma.hw.ac.uk.
5
5
  Author-email: RCCS-CaptureTeam <team@prisma-platform.org>
6
6
  License: GNUv3
@@ -27,7 +27,6 @@ This package provides:
27
27
  - legacy v1 wrappers on the main `api` object
28
28
  - a larger v2 REST client on `api.v2`
29
29
  - local config-based API-key management
30
- - optional local development routing via `api.update_dev_mode(True)`
31
30
 
32
31
  PrISMa is a platform for numerical synthesis and assessment of metal-organic frameworks and related carbon-capture workflows.
33
32
 
@@ -39,22 +38,6 @@ PrISMa is a platform for numerical synthesis and assessment of metal-organic fra
39
38
  pip install prisma_api
40
39
  ```
41
40
 
42
- ### From source
43
-
44
- ```bash
45
- git clone https://github.com/RCCS-CaptureTeam/prisma_api.git
46
- cd prisma_api
47
- pip install .
48
- ```
49
-
50
- ### Development install
51
-
52
- ```bash
53
- git clone https://github.com/RCCS-CaptureTeam/prisma_api.git
54
- cd prisma_api
55
- pip install -e ".[dev]"
56
- ```
57
-
58
41
  ### Requirements
59
42
 
60
43
  - Python 3.10+
@@ -74,6 +57,12 @@ api = prisma_api.init()
74
57
 
75
58
  On first use, the package creates a config file and prompts for an API key.
76
59
 
60
+ ### Upgrades
61
+
62
+ ```python
63
+ pip install --upgrade prisma_api
64
+ ```
65
+
77
66
  ### Find the config path
78
67
 
79
68
  ```python
@@ -127,24 +116,16 @@ materials_df = api.v2.list_materials(name="ABEX")
127
116
  print(materials_df.head())
128
117
  ```
129
118
 
130
- ### Dev mode
119
+ ### Flowsheets
131
120
 
132
121
  ```python
133
122
  import prisma_api
134
123
 
135
- api = prisma_api.init()
136
- api.update_dev_mode(True)
137
124
  api = prisma_api.init()
138
125
 
139
126
  flowsheet = api.v2.get_flowsheet(name="dac_min")
140
127
  ```
141
128
 
142
- Disable dev mode the same way:
143
-
144
- ```python
145
- api.update_dev_mode(False)
146
- api = prisma_api.init()
147
- ```
148
129
 
149
130
  ## Return formats
150
131
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "prisma_api"
7
- version = "0.3.1"
7
+ version = "0.3.3"
8
8
  description = "A package for interacting with PrISMa Platform APIs. PrISMa is a holistic system for numerical synthesis and assessment of Metal-Organic Frameworks and their applications, for Direct Air Capture of CO2. For more information, see: https://prisma.hw.ac.uk."
9
9
  authors = [
10
10
  {name = "RCCS-CaptureTeam", email = "team@prisma-platform.org"}
@@ -1440,3 +1440,20 @@ def test_get_flowsheet_uses_dev_mode_base_url(dev_api):
1440
1440
  json={"template_id": "dac_min"}, status=200)
1441
1441
  result = dev_api.get_flowsheet(name="dac_min")
1442
1442
  assert result["template_id"] == "dac_min"
1443
+
1444
+
1445
+ @resp_lib.activate
1446
+ def test_get_flowsheet_bundle_returns_dict(api):
1447
+ expected = {"template_id": "dac_min", "bundle": {"nodes": [], "edges": []}}
1448
+ resp_lib.add(resp_lib.GET, f"{PROD_BASE}/flowsheets/dac_min/bundle/",
1449
+ json=expected, status=200)
1450
+ result = api.get_flowsheet_bundle()
1451
+ assert result == expected
1452
+
1453
+
1454
+ @resp_lib.activate
1455
+ def test_get_flowsheet_bundle_uses_dev_mode_base_url(dev_api):
1456
+ resp_lib.add(resp_lib.GET, f"{dev_api._base_url()}/flowsheets/dac_min/bundle/",
1457
+ json={"template_id": "dac_min"}, status=200)
1458
+ result = dev_api.get_flowsheet_bundle()
1459
+ assert result["template_id"] == "dac_min"
File without changes
File without changes