seer-pas-sdk 0.1.2__py3-none-any.whl → 0.2.1__py3-none-any.whl

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.
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: seer-pas-sdk
3
+ Version: 0.2.1
4
+ Summary: SDK for Seer Proteograph Analysis Suite (PAS)
5
+ Author-email: Ryan Sun <rsun@seer.bio>
6
+ License:
7
+ Apache License
8
+ Version 2.0, January 2004
9
+ http://www.apache.org/licenses/
10
+
11
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12
+
13
+ 1. Definitions.
14
+
15
+ "License" shall mean the terms and conditions for use, reproduction,
16
+ and distribution as defined by Sections 1 through 9 of this document.
17
+
18
+ "Licensor" shall mean the copyright owner or entity authorized by
19
+ the copyright owner that is granting the License.
20
+
21
+ "Legal Entity" shall mean the union of the acting entity and all
22
+ other entities that control, are controlled by, or are under common
23
+ control with that entity. For the purposes of this definition,
24
+ "control" means (i) the power, direct or indirect, to cause the
25
+ direction or management of such entity, whether by contract or
26
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
27
+ outstanding shares, or (iii) beneficial ownership of such entity.
28
+
29
+ "You" (or "Your") shall mean an individual or Legal Entity
30
+ exercising permissions granted by this License.
31
+
32
+ "Source" form shall mean the preferred form for making modifications,
33
+ including but not limited to software source code, documentation
34
+ source, and configuration files.
35
+
36
+ "Object" form shall mean any form resulting from mechanical
37
+ transformation or translation of a Source form, including but
38
+ not limited to compiled object code, generated documentation,
39
+ and conversions to other media types.
40
+
41
+ "Work" shall mean the work of authorship, whether in Source or
42
+ Object form, made available under the License, as indicated by a
43
+ copyright notice that is included in or attached to the work
44
+ (an example is provided in the Appendix below).
45
+
46
+ "Derivative Works" shall mean any work, whether in Source or Object
47
+ form, that is based on (or derived from) the Work and for which the
48
+ editorial revisions, annotations, elaborations, or other modifications
49
+ represent, as a whole, an original work of authorship. For the purposes
50
+ of this License, Derivative Works shall not include works that remain
51
+ separable from, or merely link (or bind by name) to the interfaces of,
52
+ the Work and Derivative Works thereof.
53
+
54
+ "Contribution" shall mean any work of authorship, including
55
+ the original version of the Work and any modifications or additions
56
+ to that Work or Derivative Works thereof, that is intentionally
57
+ submitted to Licensor for inclusion in the Work by the copyright owner
58
+ or by an individual or Legal Entity authorized to submit on behalf of
59
+ the copyright owner. For the purposes of this definition, "submitted"
60
+ means any form of electronic, verbal, or written communication sent
61
+ to the Licensor or its representatives, including but not limited to
62
+ communication on electronic mailing lists, source code control systems,
63
+ and issue tracking systems that are managed by, or on behalf of, the
64
+ Licensor for the purpose of discussing and improving the Work, but
65
+ excluding communication that is conspicuously marked or otherwise
66
+ designated in writing by the copyright owner as "Not a Contribution."
67
+
68
+ "Contributor" shall mean Licensor and any individual or Legal Entity
69
+ on behalf of whom a Contribution has been received by Licensor and
70
+ subsequently incorporated within the Work.
71
+
72
+ 2. Grant of Copyright License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ copyright license to reproduce, prepare Derivative Works of,
76
+ publicly display, publicly perform, sublicense, and distribute the
77
+ Work and such Derivative Works in Source or Object form.
78
+
79
+ 3. Grant of Patent License. Subject to the terms and conditions of
80
+ this License, each Contributor hereby grants to You a perpetual,
81
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
82
+ (except as stated in this section) patent license to make, have made,
83
+ use, offer to sell, sell, import, and otherwise transfer the Work,
84
+ where such license applies only to those patent claims licensable
85
+ by such Contributor that are necessarily infringed by their
86
+ Contribution(s) alone or by combination of their Contribution(s)
87
+ with the Work to which such Contribution(s) was submitted. If You
88
+ institute patent litigation against any entity (including a
89
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
90
+ or a Contribution incorporated within the Work constitutes direct
91
+ or contributory patent infringement, then any patent licenses
92
+ granted to You under this License for that Work shall terminate
93
+ as of the date such litigation is filed.
94
+
95
+ 4. Redistribution. You may reproduce and distribute copies of the
96
+ Work or Derivative Works thereof in any medium, with or without
97
+ modifications, and in Source or Object form, provided that You
98
+ meet the following conditions:
99
+
100
+ (a) You must give any other recipients of the Work or
101
+ Derivative Works a copy of this License; and
102
+
103
+ (b) You must cause any modified files to carry prominent notices
104
+ stating that You changed the files; and
105
+
106
+ (c) You must retain, in the Source form of any Derivative Works
107
+ that You distribute, all copyright, patent, trademark, and
108
+ attribution notices from the Source form of the Work,
109
+ excluding those notices that do not pertain to any part of
110
+ the Derivative Works; and
111
+
112
+ (d) If the Work includes a "NOTICE" text file as part of its
113
+ distribution, then any Derivative Works that You distribute must
114
+ include a readable copy of the attribution notices contained
115
+ within such NOTICE file, excluding those notices that do not
116
+ pertain to any part of the Derivative Works, in at least one
117
+ of the following places: within a NOTICE text file distributed
118
+ as part of the Derivative Works; within the Source form or
119
+ documentation, if provided along with the Derivative Works; or,
120
+ within a display generated by the Derivative Works, if and
121
+ wherever such third-party notices normally appear. The contents
122
+ of the NOTICE file are for informational purposes only and
123
+ do not modify the License. You may add Your own attribution
124
+ notices within Derivative Works that You distribute, alongside
125
+ or as an addendum to the NOTICE text from the Work, provided
126
+ that such additional attribution notices cannot be construed
127
+ as modifying the License.
128
+
129
+ You may add Your own copyright statement to Your modifications and
130
+ may provide additional or different license terms and conditions
131
+ for use, reproduction, or distribution of Your modifications, or
132
+ for any such Derivative Works as a whole, provided Your use,
133
+ reproduction, and distribution of the Work otherwise complies with
134
+ the conditions stated in this License.
135
+
136
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
137
+ any Contribution intentionally submitted for inclusion in the Work
138
+ by You to the Licensor shall be under the terms and conditions of
139
+ this License, without any additional terms or conditions.
140
+ Notwithstanding the above, nothing herein shall supersede or modify
141
+ the terms of any separate license agreement you may have executed
142
+ with Licensor regarding such Contributions.
143
+
144
+ 6. Trademarks. This License does not grant permission to use the trade
145
+ names, trademarks, service marks, or product names of the Licensor,
146
+ except as required for reasonable and customary use in describing the
147
+ origin of the Work and reproducing the content of the NOTICE file.
148
+
149
+ 7. Disclaimer of Warranty. Unless required by applicable law or
150
+ agreed to in writing, Licensor provides the Work (and each
151
+ Contributor provides its Contributions) on an "AS IS" BASIS,
152
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
153
+ implied, including, without limitation, any warranties or conditions
154
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
155
+ PARTICULAR PURPOSE. You are solely responsible for determining the
156
+ appropriateness of using or redistributing the Work and assume any
157
+ risks associated with Your exercise of permissions under this License.
158
+
159
+ 8. Limitation of Liability. In no event and under no legal theory,
160
+ whether in tort (including negligence), contract, or otherwise,
161
+ unless required by applicable law (such as deliberate and grossly
162
+ negligent acts) or agreed to in writing, shall any Contributor be
163
+ liable to You for damages, including any direct, indirect, special,
164
+ incidental, or consequential damages of any character arising as a
165
+ result of this License or out of the use or inability to use the
166
+ Work (including but not limited to damages for loss of goodwill,
167
+ work stoppage, computer failure or malfunction, or any and all
168
+ other commercial damages or losses), even if such Contributor
169
+ has been advised of the possibility of such damages.
170
+
171
+ 9. Accepting Warranty or Additional Liability. While redistributing
172
+ the Work or Derivative Works thereof, You may choose to offer,
173
+ and charge a fee for, acceptance of support, warranty, indemnity,
174
+ or other liability obligations and/or rights consistent with this
175
+ License. However, in accepting such obligations, You may act only
176
+ on Your own behalf and on Your sole responsibility, not on behalf
177
+ of any other Contributor, and only if You agree to indemnify,
178
+ defend, and hold each Contributor harmless for any liability
179
+ incurred by, or claims asserted against, such Contributor by reason
180
+ of your accepting any such warranty or additional liability.
181
+
182
+ END OF TERMS AND CONDITIONS
183
+
184
+ Project-URL: Issues, https://github.com/seerbio/seer-pas-sdk/issues
185
+ Keywords: seer,sdk,pas,mass spectrometry,proteomics
186
+ Classifier: Development Status :: 4 - Beta
187
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
188
+ Classifier: Operating System :: OS Independent
189
+ Classifier: Programming Language :: Python :: 3
190
+ Classifier: Programming Language :: Python :: 3 :: Only
191
+ Requires-Python: >=3.8
192
+ Description-Content-Type: text/markdown
193
+ License-File: LICENSE.txt
194
+ Requires-Dist: boto3>=1.26.152
195
+ Requires-Dist: botocore>=1.29.152
196
+ Requires-Dist: pandas>=2.0.1
197
+ Requires-Dist: numpy<2.0.0,>=1.5.3
198
+ Requires-Dist: PyJWT>=2.8.0
199
+ Requires-Dist: python-dotenv>=1.0.0
200
+ Requires-Dist: Requests>=2.31.0
201
+ Requires-Dist: tqdm>=4.65.0
202
+ Dynamic: license-file
203
+
204
+ # Seer PAS Python SDK
205
+
206
+ [![Test](https://github.com/seerbio/seer-pas-sdk/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/seerbio/seer-pas-sdk/actions/workflows/test.yml)
207
+ [![Lint](https://github.com/seerbio/seer-pas-sdk/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/seerbio/seer-pas-sdk/actions/workflows/lint.yml)
208
+
209
+ This SDK permits interaction with the Seer Proteograph Analysis Suite using Python.
210
+
211
+ ## Installation
212
+
213
+ ```shell
214
+ pip install seer-pas-sdk
215
+ ```
216
+
217
+ ## Usage
218
+
219
+ To import and set up the SDK:
220
+
221
+ ```python
222
+ from seer_pas_sdk import SeerSDK
223
+
224
+ # Instantiate an SDK object with your credentials:
225
+ sdk = SeerSDK(USERNAME, PASSWORD)
226
+ ```
227
+
228
+ You can then use the SDK's methods to create, query, or retrieve projects, plates, samples, and analyses.
229
+
230
+ For complete documentation of this SDK, visit [https://seerbio.github.io/seer-pas-sdk/](https://seerbio.github.io/seer-pas-sdk/ "Documentation").
@@ -0,0 +1,18 @@
1
+ seer_pas_sdk/__init__.py,sha256=Ie6atdmdBV-OmdHHXjhrGhdFGXiyP3JKhKrr3hyvSsA,563
2
+ seer_pas_sdk/auth/__init__.py,sha256=e_eM4jJnnyKUdg4Nggzi9ypt2MLWcEJ8CmCPkUaQDSs,23
3
+ seer_pas_sdk/auth/auth.py,sha256=C9XQWg2dScHcvvypqnjmluRlH-GEuc4D9rYyG9_OnN0,2965
4
+ seer_pas_sdk/common/__init__.py,sha256=jA5qm-t9x3qXMp5Q6v7vV2kZdLw32-lnbtf0fPY4lIw,22482
5
+ seer_pas_sdk/common/errors.py,sha256=4HFORWnaQQCMXRE8kwdsJWvQRB_3KFEZ7yMb391e4gA,142
6
+ seer_pas_sdk/common/groupanalysis.py,sha256=DxB-gbQfYzl7p9MTYWDIqghcH-IeakzdYdrRZrlIHek,1730
7
+ seer_pas_sdk/core/__init__.py,sha256=rxbKgg-Qe24OaxX2zyHHYPYgDCTEKE_-41bB2wvpvL4,25
8
+ seer_pas_sdk/core/sdk.py,sha256=fUbskM4zxhVkK8i9lt6dJJi32ss4KVO3ZNOF3OB1S7c,97689
9
+ seer_pas_sdk/core/unsupported.py,sha256=FqaJrkctNIStr1YTyV2nZc4qmgje3yza221z4Y28zpM,59908
10
+ seer_pas_sdk/objects/__init__.py,sha256=HJLS6sOr7DfzdI14fv5dWcITEj5QQsKcdfED3YNvUrY,107
11
+ seer_pas_sdk/objects/groupanalysis.py,sha256=x3D_5NmYBoPDilNCQqUoCFARIfIeUq4FBY3_N6u8tfM,994
12
+ seer_pas_sdk/objects/platemap.py,sha256=8IvJPAecs_e_FyqibzhCw-O4zjCFnf-zMUp_5krTEsg,5864
13
+ seer_pas_sdk/objects/volcanoplot.py,sha256=tKuCWDIdoO8FLJlhpXhuwHn0aMYnvudTugxAslDXyGs,9357
14
+ seer_pas_sdk-0.2.1.dist-info/licenses/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
15
+ seer_pas_sdk-0.2.1.dist-info/METADATA,sha256=qD8N0JVJ5AKlzsDy2N8d56rNoef0QFh8hvWAjx-rMJY,13421
16
+ seer_pas_sdk-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ seer_pas_sdk-0.2.1.dist-info/top_level.txt,sha256=-2kZ-KFMGtXwr8H1O5llMKlcJ8gRKohEmrIvazXB61s,13
18
+ seer_pas_sdk-0.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (73.0.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,50 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: seer-pas-sdk
3
- Version: 0.1.2
4
- Summary: SDK for Seer Proteograph Analysis Suite (PAS)
5
- Home-page: https://github.com/seerbio/seer-pas-sdk
6
- Author: Agam Jolly
7
- Author-email: ajolly@seer.bio
8
- Project-URL: Bug Tracker, https://github.com/seerbio/seer-pas-sdk/issues
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
12
- Requires-Python: >=3.6
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE.txt
15
- Requires-Dist: boto3==1.26.152
16
- Requires-Dist: botocore==1.29.152
17
- Requires-Dist: pandas==2.0.1
18
- Requires-Dist: numpy<2.0.0,>=1.5.3
19
- Requires-Dist: PyJWT==2.8.0
20
- Requires-Dist: python-dotenv==1.0.0
21
- Requires-Dist: Requests==2.31.0
22
- Requires-Dist: tqdm==4.65.0
23
-
24
- # Seer PAS Python SDK
25
-
26
- [![Test](https://github.com/seerbio/seer-pas-sdk/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/seerbio/seer-pas-sdk/actions/workflows/test.yml)
27
- [![Lint](https://github.com/seerbio/seer-pas-sdk/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/seerbio/seer-pas-sdk/actions/workflows/lint.yml)
28
-
29
- This SDK permits interaction with the Seer Proteograph Analysis Suite using Python.
30
-
31
- ## Installation
32
-
33
- ```shell
34
- pip install seer-pas-sdk
35
- ```
36
-
37
- ## Usage
38
-
39
- To import and set up the SDK:
40
-
41
- ```python
42
- from seer_pas_sdk import SeerSDK
43
-
44
- # Instantiate an SDK object with your credentials:
45
- sdk = SeerSDK(USERNAME, PASSWORD)
46
- ```
47
-
48
- You can then use the SDK's functions to create, query, or retrieve projects, plates, samples, and analyses.
49
-
50
- For complete documentation of this SDK, visit [https://seerbio.github.io/seer-pas-sdk/](https://seerbio.github.io/seer-pas-sdk/ "Documentation").
@@ -1,16 +0,0 @@
1
- seer_pas_sdk/__init__.py,sha256=Ie6atdmdBV-OmdHHXjhrGhdFGXiyP3JKhKrr3hyvSsA,563
2
- seer_pas_sdk/auth/__init__.py,sha256=DZcbkYel11GvIn-iiutt9UOVfj9URZ_f89QMHhyGfRg,2277
3
- seer_pas_sdk/common/__init__.py,sha256=QnBup2dT6okt62Yjdhik4DmLf36Ozgv6KybdvFAULaA,12260
4
- seer_pas_sdk/core/__init__.py,sha256=J8dAiYsvNbc11zN1mgp7KqjHSVPw9CVwI-uc85UHw5s,47488
5
- seer_pas_sdk/objects/__init__.py,sha256=DosquJu2-XvDjVj4JFKoXa0DBVS8OroYCDeS5Np4U8Q,3693
6
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- tests/conftest.py,sha256=nu5Qu8CHwgJEwFpLQ0iX8e5csz4HGIC2oe50AdkA2Ms,317
8
- tests/test_auth.py,sha256=np4XXbEzoSFf-zXKaZQFL4Ry1ehMtjbXtHG3J6D-zzc,933
9
- tests/test_common.py,sha256=3VgHPbeLVJCh8V0kBGMvkhTKMd6sN_eLJF3AgvbyH0I,3433
10
- tests/test_objects.py,sha256=BcQtE8CbGUAnFlbkwsaJalUV6D8WbdwN2aWiQddh3k4,2521
11
- tests/test_sdk.py,sha256=ZNfsRAe_YHIXfteVugfkcds_lmYb0emIfDbJz7jpqR4,239
12
- seer_pas_sdk-0.1.2.dist-info/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
13
- seer_pas_sdk-0.1.2.dist-info/METADATA,sha256=VuuOZGQuA6LaN6MgYSZEHKBJXKRuVZxXNDFLLM63shk,1716
14
- seer_pas_sdk-0.1.2.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
15
- seer_pas_sdk-0.1.2.dist-info/top_level.txt,sha256=gMffZ5LfTF87Sr-oiyl-rtY6omfBslYCA2S4DM7YNC8,19
16
- seer_pas_sdk-0.1.2.dist-info/RECORD,,
tests/__init__.py DELETED
File without changes
tests/conftest.py DELETED
@@ -1,17 +0,0 @@
1
- """
2
- `conftest.py` -- common fixtures and other pytest config
3
- """
4
-
5
- import pytest
6
-
7
- from seer_pas_sdk import PlateMap
8
-
9
-
10
- @pytest.fixture
11
- def platemap():
12
- """A very basic platemap"""
13
- return PlateMap(
14
- ms_file_name=["test.msfile"],
15
- sample_name=["TEST_sample_name"],
16
- sample_id=["TEST0"],
17
- )
tests/test_auth.py DELETED
@@ -1,48 +0,0 @@
1
- import pytest
2
-
3
- from seer_pas_sdk.auth import Auth
4
-
5
-
6
- @pytest.fixture
7
- def password():
8
- return "XXX_fake_password"
9
-
10
-
11
- @pytest.fixture
12
- def username():
13
- return "XXX_fake_user"
14
-
15
-
16
- @pytest.fixture(
17
- params=[
18
- *Auth._instances.keys(),
19
- *Auth._instances.values(),
20
- "https://secure-https-url.example/",
21
- ]
22
- )
23
- def valid_instance(request):
24
- return request.param
25
-
26
-
27
- def test_valid_instance(username, password, valid_instance):
28
- Auth(
29
- username=username,
30
- password=password,
31
- instance=valid_instance,
32
- )
33
-
34
-
35
- @pytest.fixture(
36
- params=["XX", "http://insecure-http-url.example/", "my-favorite-instance"]
37
- )
38
- def invalid_instance(request):
39
- return request.param
40
-
41
-
42
- def test_invalid_instance(username, password, invalid_instance):
43
- with pytest.raises(ValueError):
44
- Auth(
45
- username=username,
46
- password=password,
47
- instance=invalid_instance,
48
- )
tests/test_common.py DELETED
@@ -1,99 +0,0 @@
1
- import pytest
2
-
3
- from seer_pas_sdk.common import *
4
-
5
-
6
- @pytest.fixture
7
- def mock_sample(platemap):
8
- """A file name in our mock platemap"""
9
- idx = 0
10
- return (
11
- platemap.ms_file_name[idx],
12
- platemap.sample_name[idx],
13
- platemap.sample_id[idx],
14
- )
15
-
16
-
17
- @pytest.fixture(scope="function")
18
- def platemap_file(platemap, tmpdir):
19
- """Our mock platemap, as a file"""
20
- outfile = tmpdir / "test_platemap.csv"
21
-
22
- platemap.to_csv(outfile)
23
-
24
- yield outfile
25
-
26
- # Clean up test file
27
- outfile.remove()
28
-
29
-
30
- def test_get_sample_info(platemap_file, mock_sample):
31
- """Test that get_sample_info correctly parses the platemap file"""
32
- filename, sample_name, sample_id = mock_sample
33
-
34
- plate_id = "TEST_plate_id"
35
- ms_data_files = {filename}
36
- space = "TEST_space_id"
37
- res = get_sample_info(
38
- plate_id=plate_id,
39
- ms_data_files=ms_data_files,
40
- plate_map_file=platemap_file,
41
- space=space,
42
- sample_description_file=None, # TODO: test sample description file
43
- )
44
-
45
- assert len(res) == 1
46
-
47
- for sampleinfo in res:
48
- assert sampleinfo["plateID"] == plate_id
49
- assert sampleinfo["sampleName"] == sample_name
50
- assert sampleinfo["sampleID"] == sample_id
51
- assert sampleinfo["sampleUserGroup"] == space
52
-
53
-
54
- def test_get_sample_info_missing_file(platemap_file):
55
- """Test that get_sample_info raises an exception if a file doesn't exist"""
56
-
57
- plate_id = "TEST_plate_id"
58
- ms_data_files = {"XXX_file_does_not_exist"}
59
- space = "TEST_space_id"
60
- with pytest.raises(ValueError):
61
- res = get_sample_info(
62
- plate_id=plate_id,
63
- ms_data_files=ms_data_files,
64
- plate_map_file=platemap_file,
65
- space=space,
66
- )
67
-
68
-
69
- def test_camel_case():
70
- assert camel_case("my favorite") == "myFavorite"
71
- assert camel_case("my Favorite") == "myFavorite"
72
- assert camel_case("My favorite") == "myFavorite"
73
- assert camel_case("My Favorite") == "myFavorite"
74
- assert camel_case("snake_case") == "snakeCase"
75
- assert camel_case("snake_Case") == "snakeCase"
76
- assert camel_case("Snake_case") == "snakeCase"
77
- assert camel_case("Snake_Case") == "snakeCase"
78
- assert camel_case("camelcase") == "camelcase"
79
- assert camel_case("camelCase") == "camelcase"
80
- assert camel_case("Camelcase") == "camelcase"
81
- assert camel_case("CamelCase") == "camelcase"
82
- assert camel_case("kebab-case") == "kebabCase"
83
- assert camel_case("kebab-Case") == "kebabCase"
84
- assert camel_case("Kebab-case") == "kebabCase"
85
- assert camel_case("Kebab-Case") == "kebabCase"
86
-
87
- # Corner cases:
88
- assert camel_case("two\nlines") == "two\nLines"
89
- assert camel_case("two\nLines") == "two\nLines"
90
- assert camel_case("Two\nlines") == "two\nLines"
91
- assert camel_case("Two\nLines") == "two\nLines"
92
- assert camel_case("über コンピュータコード") == "überコンピュータコード"
93
- assert camel_case("über コンピュータコード") == "überコンピュータコード"
94
- assert camel_case("Über コンピュータコード") == "überコンピュータコード"
95
- assert camel_case("Über コンピュータコード") == "überコンピュータコード"
96
- assert camel_case("clap👏back") == "clap👏Back"
97
- assert camel_case("clap👏Back") == "clap👏Back"
98
- assert camel_case("Clap👏back") == "clap👏Back"
99
- assert camel_case("Clap👏Back") == "clap👏Back"
tests/test_objects.py DELETED
@@ -1,91 +0,0 @@
1
- from io import StringIO
2
-
3
- import pandas as pd
4
- import pytest
5
-
6
- from seer_pas_sdk.objects import PlateMap
7
-
8
-
9
- def test_toofew_items():
10
- """Test passing too few items to one or more attributes"""
11
- filenames = ["test_0.msfile", "test_1.msfile"]
12
- samplenames = ["TEST_sample_name"]
13
- platemap = PlateMap(
14
- ms_file_name=filenames.copy(), # prevent mutating shared state
15
- sample_name=samplenames.copy(), # prevent mutating shared state
16
- )
17
-
18
- assert len(platemap.ms_file_name) == len(filenames)
19
- assert len(platemap.sample_name) == len(filenames)
20
-
21
- for i in range(len(platemap.sample_name)):
22
- assert (platemap.sample_name[i] == None) == (i >= len(samplenames))
23
-
24
-
25
- def test_toomany_items():
26
- with pytest.raises(ValueError):
27
- PlateMap(
28
- ms_file_name=["test.msfile"],
29
- sample_name=["TEST_sample_name_0", "TEST_sample_name_1"],
30
- )
31
-
32
-
33
- def test_platemap_to_dict(platemap):
34
- res = platemap.to_dict()
35
-
36
- assert isinstance(res, dict)
37
-
38
- for k in res:
39
- assert len(res[k]) == platemap.length
40
-
41
-
42
- def test_platemap_to_df(platemap):
43
- res = platemap.to_df()
44
-
45
- assert isinstance(res, pd.DataFrame)
46
-
47
- assert len(res) == platemap.length
48
-
49
- for k in res.columns:
50
- assert len(res[k]) == platemap.length
51
-
52
-
53
- def test_platemap_to_csv_str(platemap):
54
- res = platemap.to_csv()
55
-
56
- assert isinstance(res, str)
57
- assert len(StringIO(res).readlines()) == platemap.length + 1
58
-
59
- # Re-parse CSV with Pandas for additional checks
60
- df = pd.read_csv(StringIO(res))
61
-
62
- assert len(df) == platemap.length
63
- for k in df.columns:
64
- assert len(df[k]) == platemap.length
65
-
66
-
67
- def test_platemap_to_csv_file(platemap, tmpdir):
68
- outfile = tmpdir / "test.csv"
69
- res = platemap.to_csv(outfile)
70
-
71
- with open(outfile, "r") as f:
72
- assert len(f.readlines()) == platemap.length + 1
73
-
74
- # Re-parse CSV with Pandas for additional checks
75
- f.seek(0)
76
- df = pd.read_csv(f)
77
-
78
- assert len(df) == platemap.length
79
- for k in df.columns:
80
- assert len(df[k]) == platemap.length
81
-
82
-
83
- def test_mutate_defaults():
84
- """Test that default values in the construtor aren't shared mutable instances"""
85
-
86
- # Force extension of default (empty) values by creating a platemap with 2 samples
87
- platemap_0 = PlateMap(["test_0.msfile", "test_1.msfile"])
88
-
89
- # Now create a platemap with fewer samples; this will trigger an error if the default
90
- # values were mutated by the first call.
91
- platemap_1 = PlateMap(["test_0.msfile"])
tests/test_sdk.py DELETED
@@ -1,11 +0,0 @@
1
- """
2
- `test_sdk` -- high-level tests for the seer-pas-sdk package
3
- """
4
-
5
-
6
- def test_import():
7
- """
8
- Stub test that importing the root module is successful.
9
- TODO: replace this with more meaningful tests
10
- """
11
- import seer_pas_sdk