CoreDataX 0.10.0__tar.gz → 0.10.2__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.5
2
2
  Name: CoreDataX
3
- Version: 0.10.0
3
+ Version: 0.10.2
4
4
  Summary: API for uploading data to the PSMA's CoreDataeXchange project.
5
5
  Project-URL: Homepage, https://coredatax.com
6
6
  Project-URL: Repository, https://github.com/CoreDataX/CoreDataX
@@ -55,21 +55,30 @@ A header row is required. These columns must be present:
55
55
  | column | unit | meaning |
56
56
  | --- | --- | --- |
57
57
  | `magneticReference` | — | the reference of a magnetic already registered in CoreDataX |
58
+ | `setupReference` | — | the measurement setup; stored as the record's `setup` and `methodUsed` |
58
59
  | `frequency` | Hz | excitation frequency |
59
60
  | `magneticFluxDensityPeak` | T | peak flux density |
61
+ | `magneticFieldDcBias` | T | DC bias of the flux density (0 for symmetric excitation) |
62
+ | `magneticFieldWaveformType` | — | `sinusoidal`, `triangular`, `rectangular`, … (PEAS 1.0 spelling; the older `Sinusoidal`/`Square` names are still accepted and converted) |
60
63
  | `temperature` | °C | ambient temperature |
61
64
  | `volumetricLosses` | W/m³ | measured core losses per unit volume |
62
65
 
63
- Optional: `setupReference`, `magneticFieldDcBias` (A/m), `magneticFieldWaveformType`
64
- (e.g. `Sinusoidal`). Up to 10 000 rows per call. Rows are attributed to the
65
- authenticated user — a `userId` column is ignored.
66
+ Optional: `dutyCycle` (for non-sinusoidal excitation). Up to 10 000 rows per call.
67
+ Rows are attributed to the authenticated user — a `userId` column is ignored.
68
+
69
+ The excitation columns are not decoration: `magneticFieldWaveformType`,
70
+ `magneticFieldDcBias` and `dutyCycle` become `label`, `offset` and `dutyCycle` on
71
+ the stored CDX document, which is what CoreDataX reads back as `waveform`,
72
+ `dcBias` and `dutyCycle` — a measurement with no waveform label is dropped from
73
+ the Herbert curves.
66
74
 
67
75
  ```csv
68
76
  magneticReference,setupReference,frequency,magneticFluxDensityPeak,magneticFieldDcBias,magneticFieldWaveformType,temperature,volumetricLosses
69
- 3C90 --- TX-25-15-10,my-setup,100000,0.1,0,Sinusoidal,25,42000
77
+ 3C90 --- TX-25-15-10,my-setup,100000,0.1,0,sinusoidal,25,42000
70
78
  ```
71
79
 
72
- A row the server rejects (unknown magnetic reference, unparseable number) does not
80
+ A row the server rejects (unknown magnetic reference, unparseable number, a waveform
81
+ name it does not recognise) does not
73
82
  abort the upload — it comes back in `errors` with its CSV line number, while the
74
83
  good rows are stored.
75
84
 
@@ -33,21 +33,30 @@ A header row is required. These columns must be present:
33
33
  | column | unit | meaning |
34
34
  | --- | --- | --- |
35
35
  | `magneticReference` | — | the reference of a magnetic already registered in CoreDataX |
36
+ | `setupReference` | — | the measurement setup; stored as the record's `setup` and `methodUsed` |
36
37
  | `frequency` | Hz | excitation frequency |
37
38
  | `magneticFluxDensityPeak` | T | peak flux density |
39
+ | `magneticFieldDcBias` | T | DC bias of the flux density (0 for symmetric excitation) |
40
+ | `magneticFieldWaveformType` | — | `sinusoidal`, `triangular`, `rectangular`, … (PEAS 1.0 spelling; the older `Sinusoidal`/`Square` names are still accepted and converted) |
38
41
  | `temperature` | °C | ambient temperature |
39
42
  | `volumetricLosses` | W/m³ | measured core losses per unit volume |
40
43
 
41
- Optional: `setupReference`, `magneticFieldDcBias` (A/m), `magneticFieldWaveformType`
42
- (e.g. `Sinusoidal`). Up to 10 000 rows per call. Rows are attributed to the
43
- authenticated user — a `userId` column is ignored.
44
+ Optional: `dutyCycle` (for non-sinusoidal excitation). Up to 10 000 rows per call.
45
+ Rows are attributed to the authenticated user — a `userId` column is ignored.
46
+
47
+ The excitation columns are not decoration: `magneticFieldWaveformType`,
48
+ `magneticFieldDcBias` and `dutyCycle` become `label`, `offset` and `dutyCycle` on
49
+ the stored CDX document, which is what CoreDataX reads back as `waveform`,
50
+ `dcBias` and `dutyCycle` — a measurement with no waveform label is dropped from
51
+ the Herbert curves.
44
52
 
45
53
  ```csv
46
54
  magneticReference,setupReference,frequency,magneticFluxDensityPeak,magneticFieldDcBias,magneticFieldWaveformType,temperature,volumetricLosses
47
- 3C90 --- TX-25-15-10,my-setup,100000,0.1,0,Sinusoidal,25,42000
55
+ 3C90 --- TX-25-15-10,my-setup,100000,0.1,0,sinusoidal,25,42000
48
56
  ```
49
57
 
50
- A row the server rejects (unknown magnetic reference, unparseable number) does not
58
+ A row the server rejects (unknown magnetic reference, unparseable number, a waveform
59
+ name it does not recognise) does not
51
60
  abort the upload — it comes back in `errors` with its CSV line number, while the
52
61
  good rows are stored.
53
62
 
@@ -14,7 +14,7 @@ from .client import (
14
14
  upload_csv,
15
15
  )
16
16
 
17
- __version__ = "0.10.0"
17
+ __version__ = "0.10.2"
18
18
 
19
19
  __all__ = [
20
20
  "Client",
@@ -20,12 +20,17 @@ import requests
20
20
 
21
21
  DEFAULT_BASE_URL = "https://coredatax.com"
22
22
 
23
- #: Columns every uploaded CSV must carry (extra columns are allowed:
24
- #: ``setupReference``, ``magneticFieldDcBias``, ``magneticFieldWaveformType``).
23
+ #: Columns every uploaded CSV must carry. The excitation ones are not
24
+ #: decoration: they become label / offset on the stored CDX document, which is
25
+ #: what CoreDataX reads back as waveform / dcBias -- a measurement without them
26
+ #: is dropped from the Herbert curves. ``dutyCycle`` is the one optional extra.
25
27
  REQUIRED_CSV_COLUMNS = (
26
28
  "magneticReference",
29
+ "setupReference",
27
30
  "frequency",
28
31
  "magneticFluxDensityPeak",
32
+ "magneticFieldDcBias",
33
+ "magneticFieldWaveformType",
29
34
  "temperature",
30
35
  "volumetricLosses",
31
36
  )
@@ -98,12 +103,11 @@ class Client:
98
103
  def upload_csv(self, csv):
99
104
  """Upload measurements from a CSV file path, file object, or CSV text.
100
105
 
101
- The CSV needs a header row with at least ``magneticReference``,
102
- ``frequency``, ``magneticFluxDensityPeak``, ``temperature`` and
103
- ``volumetricLosses``; ``setupReference``, ``magneticFieldDcBias`` and
104
- ``magneticFieldWaveformType`` are used when present. Max 10 000 rows
105
- per call. The rows are attributed to the authenticated user -- a
106
- ``userId`` column, if any, is ignored.
106
+ The CSV needs a header row carrying every column in
107
+ :data:`REQUIRED_CSV_COLUMNS`; ``dutyCycle`` may be added for
108
+ non-sinusoidal excitation. Max 10 000 rows per call. The rows are
109
+ attributed to the authenticated user -- a ``userId`` column, if any,
110
+ is ignored.
107
111
 
108
112
  Returns the server's ``{'success', 'inserted', 'errors'}``; ``errors``
109
113
  holds one entry per rejected row (with its 1-based CSV line number).
@@ -0,0 +1,4 @@
1
+ magneticReference,setupReference,frequency,magneticFluxDensityPeak,magneticFieldDcBias,magneticFieldWaveformType,temperature,volumetricLosses,userId
2
+ 3C94 --- TX-20-10-7,My setup,112160,0.0885929,0,triangular,25,87198.16,1
3
+ 3C94 --- TX-20-10-7,My setup,112160,0.0990441,0,triangular,25,114103.336,1
4
+ 3C94 --- TX-20-10-7,My setup,112160,0.110654,0,triangular,25,150794.77,1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "CoreDataX"
7
- version = "0.10.0"
7
+ version = "0.10.2"
8
8
  description = "API for uploading data to the PSMA's CoreDataeXchange project."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,4 +0,0 @@
1
- magneticReference,setupReference,frequency,magneticFluxDensityPeak,magneticFieldDcBias,magneticFieldWaveformType,temperature,volumetricLosses,userId
2
- 3C94 --- TX-20-10-7,My setup,112160,0.0885929,0,Triangular,25,87198.16,1
3
- 3C94 --- TX-20-10-7,My setup,112160,0.0990441,0,Triangular,25,114103.336,1
4
- 3C94 --- TX-20-10-7,My setup,112160,0.110654,0,Triangular,25,150794.77,1