pydiffit 0.9.1__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.
- pydiffit-0.9.1/LICENSE +403 -0
- pydiffit-0.9.1/PKG-INFO +241 -0
- pydiffit-0.9.1/README.md +202 -0
- pydiffit-0.9.1/pydiffit/__init__.py +3 -0
- pydiffit-0.9.1/pydiffit/__main__.py +181 -0
- pydiffit-0.9.1/pydiffit/agent.py +1088 -0
- pydiffit-0.9.1/pydiffit/batch.py +135 -0
- pydiffit-0.9.1/pydiffit/common.py +106 -0
- pydiffit-0.9.1/pydiffit/core.py +2769 -0
- pydiffit-0.9.1/pydiffit/dataops.py +178 -0
- pydiffit-0.9.1/pydiffit/estimate.py +262 -0
- pydiffit-0.9.1/pydiffit/follow.py +123 -0
- pydiffit-0.9.1/pydiffit/globalfit.py +190 -0
- pydiffit-0.9.1/pydiffit/gui_qt.py +1827 -0
- pydiffit-0.9.1/pydiffit/help.html +635 -0
- pydiffit-0.9.1/pydiffit/icon.png +0 -0
- pydiffit-0.9.1/pydiffit/mcp_server.py +219 -0
- pydiffit-0.9.1/pydiffit/models.py +435 -0
- pydiffit-0.9.1/pydiffit/procedure.py +265 -0
- pydiffit-0.9.1/pydiffit/readers.py +959 -0
- pydiffit-0.9.1/pydiffit/results.py +849 -0
- pydiffit-0.9.1/pydiffit/session.py +132 -0
- pydiffit-0.9.1/pydiffit.egg-info/PKG-INFO +241 -0
- pydiffit-0.9.1/pydiffit.egg-info/SOURCES.txt +29 -0
- pydiffit-0.9.1/pydiffit.egg-info/dependency_links.txt +1 -0
- pydiffit-0.9.1/pydiffit.egg-info/entry_points.txt +5 -0
- pydiffit-0.9.1/pydiffit.egg-info/requires.txt +19 -0
- pydiffit-0.9.1/pydiffit.egg-info/top_level.txt +1 -0
- pydiffit-0.9.1/pyproject.toml +54 -0
- pydiffit-0.9.1/setup.cfg +4 -0
- pydiffit-0.9.1/tests/test_pydiffit.py +1816 -0
pydiffit-0.9.1/LICENSE
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
pydiffit
|
|
2
|
+
Copyright (c) 2026, Jörg Strempfer
|
|
3
|
+
|
|
4
|
+
Licensed under the Creative Commons Attribution 4.0 International Public
|
|
5
|
+
License (CC BY 4.0), https://creativecommons.org/licenses/by/4.0/
|
|
6
|
+
The full text of the license follows.
|
|
7
|
+
|
|
8
|
+
Attribution 4.0 International
|
|
9
|
+
|
|
10
|
+
=======================================================================
|
|
11
|
+
|
|
12
|
+
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
|
13
|
+
does not provide legal services or legal advice. Distribution of
|
|
14
|
+
Creative Commons public licenses does not create a lawyer-client or
|
|
15
|
+
other relationship. Creative Commons makes its licenses and related
|
|
16
|
+
information available on an "as-is" basis. Creative Commons gives no
|
|
17
|
+
warranties regarding its licenses, any material licensed under their
|
|
18
|
+
terms and conditions, or any related information. Creative Commons
|
|
19
|
+
disclaims all liability for damages resulting from their use to the
|
|
20
|
+
fullest extent possible.
|
|
21
|
+
|
|
22
|
+
Using Creative Commons Public Licenses
|
|
23
|
+
|
|
24
|
+
Creative Commons public licenses provide a standard set of terms and
|
|
25
|
+
conditions that creators and other rights holders may use to share
|
|
26
|
+
original works of authorship and other material subject to copyright
|
|
27
|
+
and certain other rights specified in the public license below. The
|
|
28
|
+
following considerations are for informational purposes only, are not
|
|
29
|
+
exhaustive, and do not form part of our licenses.
|
|
30
|
+
|
|
31
|
+
Considerations for licensors: Our public licenses are
|
|
32
|
+
intended for use by those authorized to give the public
|
|
33
|
+
permission to use material in ways otherwise restricted by
|
|
34
|
+
copyright and certain other rights. Our licenses are
|
|
35
|
+
irrevocable. Licensors should read and understand the terms
|
|
36
|
+
and conditions of the license they choose before applying it.
|
|
37
|
+
Licensors should also secure all rights necessary before
|
|
38
|
+
applying our licenses so that the public can reuse the
|
|
39
|
+
material as expected. Licensors should clearly mark any
|
|
40
|
+
material not subject to the license. This includes other CC-
|
|
41
|
+
licensed material, or material used under an exception or
|
|
42
|
+
limitation to copyright. More considerations for licensors:
|
|
43
|
+
wiki.creativecommons.org/Considerations_for_licensors
|
|
44
|
+
|
|
45
|
+
Considerations for the public: By using one of our public
|
|
46
|
+
licenses, a licensor grants the public permission to use the
|
|
47
|
+
licensed material under specified terms and conditions. If
|
|
48
|
+
the licensor's permission is not necessary for any reason--for
|
|
49
|
+
example, because of any applicable exception or limitation to
|
|
50
|
+
copyright--then that use is not regulated by the license. Our
|
|
51
|
+
licenses grant only permissions under copyright and certain
|
|
52
|
+
other rights that a licensor has authority to grant. Use of
|
|
53
|
+
the licensed material may still be restricted for other
|
|
54
|
+
reasons, including because others have copyright or other
|
|
55
|
+
rights in the material. A licensor may make special requests,
|
|
56
|
+
such as asking that all changes be marked or described.
|
|
57
|
+
Although not required by our licenses, you are encouraged to
|
|
58
|
+
respect those requests where reasonable. More considerations
|
|
59
|
+
for the public:
|
|
60
|
+
wiki.creativecommons.org/Considerations_for_licensees
|
|
61
|
+
|
|
62
|
+
=======================================================================
|
|
63
|
+
|
|
64
|
+
Creative Commons Attribution 4.0 International Public License
|
|
65
|
+
|
|
66
|
+
By exercising the Licensed Rights (defined below), You accept and agree
|
|
67
|
+
to be bound by the terms and conditions of this Creative Commons
|
|
68
|
+
Attribution 4.0 International Public License ("Public License"). To the
|
|
69
|
+
extent this Public License may be interpreted as a contract, You are
|
|
70
|
+
granted the Licensed Rights in consideration of Your acceptance of
|
|
71
|
+
these terms and conditions, and the Licensor grants You such rights in
|
|
72
|
+
consideration of benefits the Licensor receives from making the
|
|
73
|
+
Licensed Material available under these terms and conditions.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
Section 1 -- Definitions.
|
|
77
|
+
|
|
78
|
+
a. Adapted Material means material subject to Copyright and Similar
|
|
79
|
+
Rights that is derived from or based upon the Licensed Material
|
|
80
|
+
and in which the Licensed Material is translated, altered,
|
|
81
|
+
arranged, transformed, or otherwise modified in a manner requiring
|
|
82
|
+
permission under the Copyright and Similar Rights held by the
|
|
83
|
+
Licensor. For purposes of this Public License, where the Licensed
|
|
84
|
+
Material is a musical work, performance, or sound recording,
|
|
85
|
+
Adapted Material is always produced where the Licensed Material is
|
|
86
|
+
synched in timed relation with a moving image.
|
|
87
|
+
|
|
88
|
+
b. Adapter's License means the license You apply to Your Copyright
|
|
89
|
+
and Similar Rights in Your contributions to Adapted Material in
|
|
90
|
+
accordance with the terms and conditions of this Public License.
|
|
91
|
+
|
|
92
|
+
c. Copyright and Similar Rights means copyright and/or similar rights
|
|
93
|
+
closely related to copyright including, without limitation,
|
|
94
|
+
performance, broadcast, sound recording, and Sui Generis Database
|
|
95
|
+
Rights, without regard to how the rights are labeled or
|
|
96
|
+
categorized. For purposes of this Public License, the rights
|
|
97
|
+
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
|
98
|
+
Rights.
|
|
99
|
+
|
|
100
|
+
d. Effective Technological Measures means those measures that, in the
|
|
101
|
+
absence of proper authority, may not be circumvented under laws
|
|
102
|
+
fulfilling obligations under Article 11 of the WIPO Copyright
|
|
103
|
+
Treaty adopted on December 20, 1996, and/or similar international
|
|
104
|
+
agreements.
|
|
105
|
+
|
|
106
|
+
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
|
107
|
+
any other exception or limitation to Copyright and Similar Rights
|
|
108
|
+
that applies to Your use of the Licensed Material.
|
|
109
|
+
|
|
110
|
+
f. Licensed Material means the artistic or literary work, database,
|
|
111
|
+
or other material to which the Licensor applied this Public
|
|
112
|
+
License.
|
|
113
|
+
|
|
114
|
+
g. Licensed Rights means the rights granted to You subject to the
|
|
115
|
+
terms and conditions of this Public License, which are limited to
|
|
116
|
+
all Copyright and Similar Rights that apply to Your use of the
|
|
117
|
+
Licensed Material and that the Licensor has authority to license.
|
|
118
|
+
|
|
119
|
+
h. Licensor means the individual(s) or entity(ies) granting rights
|
|
120
|
+
under this Public License.
|
|
121
|
+
|
|
122
|
+
i. Share means to provide material to the public by any means or
|
|
123
|
+
process that requires permission under the Licensed Rights, such
|
|
124
|
+
as reproduction, public display, public performance, distribution,
|
|
125
|
+
dissemination, communication, or importation, and to make material
|
|
126
|
+
available to the public including in ways that members of the
|
|
127
|
+
public may access the material from a place and at a time
|
|
128
|
+
individually chosen by them.
|
|
129
|
+
|
|
130
|
+
j. Sui Generis Database Rights means rights other than copyright
|
|
131
|
+
resulting from Directive 96/9/EC of the European Parliament and of
|
|
132
|
+
the Council of 11 March 1996 on the legal protection of databases,
|
|
133
|
+
as amended and/or succeeded, as well as other essentially
|
|
134
|
+
equivalent rights anywhere in the world.
|
|
135
|
+
|
|
136
|
+
k. You means the individual or entity exercising the Licensed Rights
|
|
137
|
+
under this Public License. Your has a corresponding meaning.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
Section 2 -- Scope.
|
|
141
|
+
|
|
142
|
+
a. License grant.
|
|
143
|
+
|
|
144
|
+
1. Subject to the terms and conditions of this Public License,
|
|
145
|
+
the Licensor hereby grants You a worldwide, royalty-free,
|
|
146
|
+
non-sublicensable, non-exclusive, irrevocable license to
|
|
147
|
+
exercise the Licensed Rights in the Licensed Material to:
|
|
148
|
+
|
|
149
|
+
a. reproduce and Share the Licensed Material, in whole or
|
|
150
|
+
in part; and
|
|
151
|
+
|
|
152
|
+
b. produce, reproduce, and Share Adapted Material.
|
|
153
|
+
|
|
154
|
+
2. Exceptions and Limitations. For the avoidance of doubt, where
|
|
155
|
+
Exceptions and Limitations apply to Your use, this Public
|
|
156
|
+
License does not apply, and You do not need to comply with
|
|
157
|
+
its terms and conditions.
|
|
158
|
+
|
|
159
|
+
3. Term. The term of this Public License is specified in Section
|
|
160
|
+
6(a).
|
|
161
|
+
|
|
162
|
+
4. Media and formats; technical modifications allowed. The
|
|
163
|
+
Licensor authorizes You to exercise the Licensed Rights in
|
|
164
|
+
all media and formats whether now known or hereafter created,
|
|
165
|
+
and to make technical modifications necessary to do so. The
|
|
166
|
+
Licensor waives and/or agrees not to assert any right or
|
|
167
|
+
authority to forbid You from making technical modifications
|
|
168
|
+
necessary to exercise the Licensed Rights, including
|
|
169
|
+
technical modifications necessary to circumvent Effective
|
|
170
|
+
Technological Measures. For purposes of this Public License,
|
|
171
|
+
simply making modifications authorized by this Section 2(a)
|
|
172
|
+
(4) never produces Adapted Material.
|
|
173
|
+
|
|
174
|
+
5. Downstream recipients.
|
|
175
|
+
|
|
176
|
+
a. Offer from the Licensor -- Licensed Material. Every
|
|
177
|
+
recipient of the Licensed Material automatically
|
|
178
|
+
receives an offer from the Licensor to exercise the
|
|
179
|
+
Licensed Rights under the terms and conditions of this
|
|
180
|
+
Public License.
|
|
181
|
+
|
|
182
|
+
b. No downstream restrictions. You may not offer or impose
|
|
183
|
+
any additional or different terms or conditions on, or
|
|
184
|
+
apply any Effective Technological Measures to, the
|
|
185
|
+
Licensed Material if doing so restricts exercise of the
|
|
186
|
+
Licensed Rights by any recipient of the Licensed
|
|
187
|
+
Material.
|
|
188
|
+
|
|
189
|
+
6. No endorsement. Nothing in this Public License constitutes or
|
|
190
|
+
may be construed as permission to assert or imply that You
|
|
191
|
+
are, or that Your use of the Licensed Material is, connected
|
|
192
|
+
with, or sponsored, endorsed, or granted official status by,
|
|
193
|
+
the Licensor or others designated to receive attribution as
|
|
194
|
+
provided in Section 3(a)(1)(A)(i).
|
|
195
|
+
|
|
196
|
+
b. Other rights.
|
|
197
|
+
|
|
198
|
+
1. Moral rights, such as the right of integrity, are not
|
|
199
|
+
licensed under this Public License, nor are publicity,
|
|
200
|
+
privacy, and/or other similar personality rights; however, to
|
|
201
|
+
the extent possible, the Licensor waives and/or agrees not to
|
|
202
|
+
assert any such rights held by the Licensor to the limited
|
|
203
|
+
extent necessary to allow You to exercise the Licensed
|
|
204
|
+
Rights, but not otherwise.
|
|
205
|
+
|
|
206
|
+
2. Patent and trademark rights are not licensed under this
|
|
207
|
+
Public License.
|
|
208
|
+
|
|
209
|
+
3. To the extent possible, the Licensor waives any right to
|
|
210
|
+
collect royalties from You for the exercise of the Licensed
|
|
211
|
+
Rights, whether directly or through a collecting society
|
|
212
|
+
under any voluntary or waivable statutory or compulsory
|
|
213
|
+
licensing scheme. In all other cases the Licensor expressly
|
|
214
|
+
reserves any right to collect such royalties.
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
Section 3 -- License Conditions.
|
|
218
|
+
|
|
219
|
+
Your exercise of the Licensed Rights is expressly made subject to the
|
|
220
|
+
following conditions.
|
|
221
|
+
|
|
222
|
+
a. Attribution.
|
|
223
|
+
|
|
224
|
+
1. If You Share the Licensed Material (including in modified
|
|
225
|
+
form), You must:
|
|
226
|
+
|
|
227
|
+
a. retain the following if it is supplied by the Licensor
|
|
228
|
+
with the Licensed Material:
|
|
229
|
+
|
|
230
|
+
i. identification of the creator(s) of the Licensed
|
|
231
|
+
Material and any others designated to receive
|
|
232
|
+
attribution, in any reasonable manner requested by
|
|
233
|
+
the Licensor (including by pseudonym if
|
|
234
|
+
designated);
|
|
235
|
+
|
|
236
|
+
ii. a copyright notice;
|
|
237
|
+
|
|
238
|
+
iii. a notice that refers to this Public License;
|
|
239
|
+
|
|
240
|
+
iv. a notice that refers to the disclaimer of
|
|
241
|
+
warranties;
|
|
242
|
+
|
|
243
|
+
v. a URI or hyperlink to the Licensed Material to the
|
|
244
|
+
extent reasonably practicable;
|
|
245
|
+
|
|
246
|
+
b. indicate if You modified the Licensed Material and
|
|
247
|
+
retain an indication of any previous modifications; and
|
|
248
|
+
|
|
249
|
+
c. indicate the Licensed Material is licensed under this
|
|
250
|
+
Public License, and include the text of, or the URI or
|
|
251
|
+
hyperlink to, this Public License.
|
|
252
|
+
|
|
253
|
+
2. You may satisfy the conditions in Section 3(a)(1) in any
|
|
254
|
+
reasonable manner based on the medium, means, and context in
|
|
255
|
+
which You Share the Licensed Material. For example, it may be
|
|
256
|
+
reasonable to satisfy the conditions by providing a URI or
|
|
257
|
+
hyperlink to a resource that includes the required
|
|
258
|
+
information.
|
|
259
|
+
|
|
260
|
+
3. If requested by the Licensor, You must remove any of the
|
|
261
|
+
information required by Section 3(a)(1)(A) to the extent
|
|
262
|
+
reasonably practicable.
|
|
263
|
+
|
|
264
|
+
4. If You Share Adapted Material You produce, the Adapter's
|
|
265
|
+
License You apply must not prevent recipients of the Adapted
|
|
266
|
+
Material from complying with this Public License.
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
Section 4 -- Sui Generis Database Rights.
|
|
270
|
+
|
|
271
|
+
Where the Licensed Rights include Sui Generis Database Rights that
|
|
272
|
+
apply to Your use of the Licensed Material:
|
|
273
|
+
|
|
274
|
+
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
|
275
|
+
to extract, reuse, reproduce, and Share all or a substantial
|
|
276
|
+
portion of the contents of the database;
|
|
277
|
+
|
|
278
|
+
b. if You include all or a substantial portion of the database
|
|
279
|
+
contents in a database in which You have Sui Generis Database
|
|
280
|
+
Rights, then the database in which You have Sui Generis Database
|
|
281
|
+
Rights (but not its individual contents) is Adapted Material; and
|
|
282
|
+
|
|
283
|
+
c. You must comply with the conditions in Section 3(a) if You Share
|
|
284
|
+
all or a substantial portion of the contents of the database.
|
|
285
|
+
|
|
286
|
+
For the avoidance of doubt, this Section 4 supplements and does not
|
|
287
|
+
replace Your obligations under this Public License where the Licensed
|
|
288
|
+
Rights include other Copyright and Similar Rights.
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
|
292
|
+
|
|
293
|
+
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
|
294
|
+
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
|
295
|
+
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
|
296
|
+
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
|
297
|
+
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
|
298
|
+
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
299
|
+
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
|
300
|
+
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
|
301
|
+
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
|
302
|
+
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
|
303
|
+
|
|
304
|
+
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
|
305
|
+
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
|
306
|
+
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
|
307
|
+
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
|
308
|
+
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
|
309
|
+
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
|
310
|
+
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
|
311
|
+
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
|
312
|
+
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
|
313
|
+
|
|
314
|
+
c. The disclaimer of warranties and limitation of liability provided
|
|
315
|
+
above shall be interpreted in a manner that, to the extent
|
|
316
|
+
possible, most closely approximates an absolute disclaimer and
|
|
317
|
+
waiver of all liability.
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
Section 6 -- Term and Termination.
|
|
321
|
+
|
|
322
|
+
a. This Public License applies for the term of the Copyright and
|
|
323
|
+
Similar Rights licensed here. However, if You fail to comply with
|
|
324
|
+
this Public License, then Your rights under this Public License
|
|
325
|
+
terminate automatically.
|
|
326
|
+
|
|
327
|
+
b. Where Your right to use the Licensed Material has terminated under
|
|
328
|
+
Section 6(a), it reinstates:
|
|
329
|
+
|
|
330
|
+
1. automatically as of the date the violation is cured, provided
|
|
331
|
+
it is cured within 30 days of Your discovery of the
|
|
332
|
+
violation; or
|
|
333
|
+
|
|
334
|
+
2. upon express reinstatement by the Licensor.
|
|
335
|
+
|
|
336
|
+
For the avoidance of doubt, this Section 6(b) does not affect any
|
|
337
|
+
right the Licensor may have to seek remedies for Your violations
|
|
338
|
+
of this Public License.
|
|
339
|
+
|
|
340
|
+
c. For the avoidance of doubt, the Licensor may also offer the
|
|
341
|
+
Licensed Material under separate terms or conditions or stop
|
|
342
|
+
distributing the Licensed Material at any time; however, doing so
|
|
343
|
+
will not terminate this Public License.
|
|
344
|
+
|
|
345
|
+
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
|
346
|
+
License.
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
Section 7 -- Other Terms and Conditions.
|
|
350
|
+
|
|
351
|
+
a. The Licensor shall not be bound by any additional or different
|
|
352
|
+
terms or conditions communicated by You unless expressly agreed.
|
|
353
|
+
|
|
354
|
+
b. Any arrangements, understandings, or agreements regarding the
|
|
355
|
+
Licensed Material not stated herein are separate from and
|
|
356
|
+
independent of the terms and conditions of this Public License.
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
Section 8 -- Interpretation.
|
|
360
|
+
|
|
361
|
+
a. For the avoidance of doubt, this Public License does not, and
|
|
362
|
+
shall not be interpreted to, reduce, limit, restrict, or impose
|
|
363
|
+
conditions on any use of the Licensed Material that could lawfully
|
|
364
|
+
be made without permission under this Public License.
|
|
365
|
+
|
|
366
|
+
b. To the extent possible, if any provision of this Public License is
|
|
367
|
+
deemed unenforceable, it shall be automatically reformed to the
|
|
368
|
+
minimum extent necessary to make it enforceable. If the provision
|
|
369
|
+
cannot be reformed, it shall be severed from this Public License
|
|
370
|
+
without affecting the enforceability of the remaining terms and
|
|
371
|
+
conditions.
|
|
372
|
+
|
|
373
|
+
c. No term or condition of this Public License will be waived and no
|
|
374
|
+
failure to comply consented to unless expressly agreed to by the
|
|
375
|
+
Licensor.
|
|
376
|
+
|
|
377
|
+
d. Nothing in this Public License constitutes or may be interpreted
|
|
378
|
+
as a limitation upon, or waiver of, any privileges and immunities
|
|
379
|
+
that apply to the Licensor or You, including from the legal
|
|
380
|
+
processes of any jurisdiction or authority.
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
=======================================================================
|
|
384
|
+
|
|
385
|
+
Creative Commons is not a party to its public
|
|
386
|
+
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
|
387
|
+
its public licenses to material it publishes and in those instances
|
|
388
|
+
will be considered the “Licensor.” The text of the Creative Commons
|
|
389
|
+
public licenses is dedicated to the public domain under the CC0 Public
|
|
390
|
+
Domain Dedication. Except for the limited purpose of indicating that
|
|
391
|
+
material is shared under a Creative Commons public license or as
|
|
392
|
+
otherwise permitted by the Creative Commons policies published at
|
|
393
|
+
creativecommons.org/policies, Creative Commons does not authorize the
|
|
394
|
+
use of the trademark "Creative Commons" or any other trademark or logo
|
|
395
|
+
of Creative Commons without its prior written consent including,
|
|
396
|
+
without limitation, in connection with any unauthorized modifications
|
|
397
|
+
to any of its public licenses or any other arrangements,
|
|
398
|
+
understandings, or agreements concerning use of licensed material. For
|
|
399
|
+
the avoidance of doubt, this paragraph does not form part of the
|
|
400
|
+
public licenses.
|
|
401
|
+
|
|
402
|
+
Creative Commons may be contacted at creativecommons.org.
|
|
403
|
+
|
pydiffit-0.9.1/PKG-INFO
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pydiffit
|
|
3
|
+
Version: 0.9.1
|
|
4
|
+
Summary: Peak fitting of diffraction scans: Python port of DIFFIT (Brueckel, Vrtis)
|
|
5
|
+
Author: Jörg Strempfer
|
|
6
|
+
License-Expression: CC-BY-4.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/strempfer/pydiffit
|
|
8
|
+
Project-URL: Source, https://github.com/strempfer/pydiffit
|
|
9
|
+
Project-URL: Documentation, https://github.com/strempfer/pydiffit#readme
|
|
10
|
+
Project-URL: Issues, https://github.com/strempfer/pydiffit/issues
|
|
11
|
+
Keywords: diffraction,peak fitting,x-ray,neutron,synchrotron,DIFFIT,SPEC,NeXus,Bluesky,batch fitting
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy>=1.22
|
|
24
|
+
Requires-Dist: scipy>=1.8
|
|
25
|
+
Requires-Dist: matplotlib>=3.5
|
|
26
|
+
Requires-Dist: lmfit>=1.2
|
|
27
|
+
Requires-Dist: h5py>=3.6
|
|
28
|
+
Requires-Dist: PySide6>=6.4
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest; extra == "test"
|
|
31
|
+
Provides-Extra: mcp
|
|
32
|
+
Requires-Dist: mcp>=1.2; extra == "mcp"
|
|
33
|
+
Provides-Extra: xraydb
|
|
34
|
+
Requires-Dist: xraydb; extra == "xraydb"
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: mcp>=1.2; extra == "all"
|
|
37
|
+
Requires-Dist: xraydb; extra == "all"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# pydiffit
|
|
41
|
+
|
|
42
|
+
Python port of DIFFIT (T. Brückel and M. Vrtis)
|
|
43
|
+
by Jörg Strempfer, Argonne National Laboratory.
|
|
44
|
+
|
|
45
|
+
pydiffit, including its Qt interface, was developed with
|
|
46
|
+
[Claude Code](https://claude.com/claude-code), Anthropic's AI coding assistant:
|
|
47
|
+
the code was written by Claude following Jörg Strempfer's design, requests and
|
|
48
|
+
testing. Commits made this way carry a `Co-Authored-By: Claude` line.
|
|
49
|
+
|
|
50
|
+
Full documentation: `pydiffit/help.html`, also under *Help* in the program menu bar, together
|
|
51
|
+
with the version history.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
pydiffit is on GitHub: <https://github.com/strempfer/pydiffit> (public, no GitHub
|
|
56
|
+
account needed). Released versions are tagged, e.g. `v0.9.1`.
|
|
57
|
+
Leave out `@v0.9.1` below to get the newest version on `main`.
|
|
58
|
+
|
|
59
|
+
### pip install from PyPI (simplest)
|
|
60
|
+
|
|
61
|
+
python -m pip install pydiffit # or "pydiffit[all]": also mcp, xraydb
|
|
62
|
+
pydiffit [file or folder]
|
|
63
|
+
|
|
64
|
+
Python 3.9 or newer; pip also installs PySide6 (Qt) and the other dependencies.
|
|
65
|
+
Update with `python -m pip install --upgrade pydiffit`. In a conda environment,
|
|
66
|
+
create it from `environment.yml` first (see 1.) and then run pip.
|
|
67
|
+
|
|
68
|
+
### 1. Clone with git and use conda (recommended for development)
|
|
69
|
+
|
|
70
|
+
git clone https://github.com/strempfer/pydiffit.git
|
|
71
|
+
cd pydiffit
|
|
72
|
+
git checkout v0.9.1 # optional: a released version
|
|
73
|
+
conda env create -f environment.yml # macOS and Linux, once
|
|
74
|
+
conda activate pydiffit
|
|
75
|
+
./pydiffit.sh [file or folder]
|
|
76
|
+
|
|
77
|
+
To get a `pydiffit` command, install it into the environment (use `python -m pip`,
|
|
78
|
+
so that the environment's pip is used and not a system pip):
|
|
79
|
+
|
|
80
|
+
python -m pip install -e .
|
|
81
|
+
pydiffit [file or folder]
|
|
82
|
+
|
|
83
|
+
Update later with `git pull` (no reinstall needed with `-e`). This way includes
|
|
84
|
+
the examples and tests.
|
|
85
|
+
|
|
86
|
+
### 2. pip install directly from GitHub
|
|
87
|
+
|
|
88
|
+
python -m pip install "git+https://github.com/strempfer/pydiffit.git@v0.9.1"
|
|
89
|
+
pydiffit [file or folder]
|
|
90
|
+
|
|
91
|
+
pip also installs PySide6 and the other dependencies. In a conda environment,
|
|
92
|
+
install those with conda first (`conda env create -f environment.yml`, see 1.) and then
|
|
93
|
+
run pip. Update with `python -m pip install --upgrade` and the same URL.
|
|
94
|
+
Examples and tests are not installed.
|
|
95
|
+
|
|
96
|
+
### 3. One conda command
|
|
97
|
+
|
|
98
|
+
[`environment-git.yml`](https://github.com/strempfer/pydiffit/blob/main/environment-git.yml) creates an environment named
|
|
99
|
+
`pydiffit` with all dependencies and pydiffit itself (from GitHub, via pip). Download
|
|
100
|
+
that single file and run:
|
|
101
|
+
|
|
102
|
+
conda env create -f environment-git.yml
|
|
103
|
+
conda activate pydiffit
|
|
104
|
+
pydiffit [file or folder]
|
|
105
|
+
|
|
106
|
+
### 4. Download a ZIP (no git)
|
|
107
|
+
|
|
108
|
+
On the GitHub page use *Code > Download ZIP* for the newest version, or for a
|
|
109
|
+
release <https://github.com/strempfer/pydiffit/archive/refs/tags/v0.9.1.zip>. Unpack it and
|
|
110
|
+
continue as in 1. (without `git clone` and `git checkout`):
|
|
111
|
+
|
|
112
|
+
cd pydiffit-0.9.1 # or pydiffit-main
|
|
113
|
+
conda env create -f environment.yml
|
|
114
|
+
conda activate pydiffit
|
|
115
|
+
./pydiffit.sh [file or folder]
|
|
116
|
+
|
|
117
|
+
### Linux
|
|
118
|
+
|
|
119
|
+
pydiffit --install-desktop # or: ./pydiffit.sh --install-desktop
|
|
120
|
+
|
|
121
|
+
adds pydiffit with its icon to the application menu (GNOME, KDE, Xfce, ...): a
|
|
122
|
+
`pydiffit.desktop` file in `~/.local/share/applications` that starts it with the
|
|
123
|
+
same Python, e.g. the conda environment. `--uninstall-desktop` removes it again.
|
|
124
|
+
|
|
125
|
+
If the window does not open, `pydiffit --info` checks the display. Usual reasons:
|
|
126
|
+
|
|
127
|
+
* *Could not load the Qt platform plugin "xcb"*: Qt 6.5 or newer needs
|
|
128
|
+
`libxcb-cursor0` (`sudo apt install libxcb-cursor0`, or `sudo dnf install
|
|
129
|
+
xcb-util-cursor`, or `conda install -c conda-forge xcb-util-cursor` in the environment).
|
|
130
|
+
* No display over ssh: log in with `ssh -X` (or `-Y`). Over slow connections a
|
|
131
|
+
remote desktop (NoMachine, VNC) is smoother.
|
|
132
|
+
* Wayland problems: `QT_QPA_PLATFORM=xcb pydiffit` uses X11 (XWayland) instead.
|
|
133
|
+
* High-resolution screens: `QT_SCALE_FACTOR=1.5 pydiffit`.
|
|
134
|
+
|
|
135
|
+
Large scan folders (thousands of files, also on NFS) open at once: the file names
|
|
136
|
+
are listed first and the files are read in the background while you work.
|
|
137
|
+
|
|
138
|
+
### Procedures without a window
|
|
139
|
+
|
|
140
|
+
*Fit > Save procedure* stores model, fit range, data settings and the batch settings
|
|
141
|
+
(`p<scan>.json`); repeat them on other data without the GUI:
|
|
142
|
+
|
|
143
|
+
pydiffit --run p63.json /data/sample2 --scans 100,180,2 --out /data/results
|
|
144
|
+
|
|
145
|
+
### Without conda, and checks
|
|
146
|
+
|
|
147
|
+
`python -m pip install -r requirements.txt` in the unpacked or cloned directory
|
|
148
|
+
installs the dependencies (including PySide6). Optional packages: `mcp` for Ask
|
|
149
|
+
Claude and `xraydb` for tabulated absorption coefficients (absorption from
|
|
150
|
+
fluorescence), e.g. `python -m pip install mcp xraydb`. `pydiffit --info` (or
|
|
151
|
+
`./pydiffit.sh --info`) shows the version, Python and whether PySide6 loads.
|
|
152
|
+
Requires Python 3.9 or newer (tested with 3.9, 3.12 and 3.15). Run the tests with `pytest tests`; GitHub Actions runs them on Linux (Ubuntu, Python 3.9, 3.12, 3.13) after every push.
|
|
153
|
+
Code layout: `core.py` holds the main-window logic (with `session.py` and `follow.py`), `results.py` the batch results window, `common.py` shared helpers, `gui_qt.py` the Qt interface;
|
|
154
|
+
`models.py`, `readers.py`, `estimate.py`, `dataops.py` and `batch.py` do the fitting and I/O.
|
|
155
|
+
|
|
156
|
+
## Data
|
|
157
|
+
* **Folder of HDF5 scans** (APS POLAR / Bluesky, one scan per file such as
|
|
158
|
+
`scan_000100_master.hdf`): *Open folder...*, or *Open file...* on any one of
|
|
159
|
+
them. Every file is one entry in the scan list (newest selected); SPEC and other
|
|
160
|
+
files in the folder are ignored, files without data (aborted scans) are skipped.
|
|
161
|
+
Columns = the 1-D datasets of `entry/data`. X, Y and monitor default to the
|
|
162
|
+
Bluesky hints (scanned motor, detector, monitor). Data are read only when a
|
|
163
|
+
scan is shown or fitted, so large folders open in about a second. Temperatures
|
|
164
|
+
from the baseline stream (`temp_*` start/end) are available in batch results.
|
|
165
|
+
*Reload* (Cmd-R) picks up new scans during the experiment.
|
|
166
|
+
* **Folder of FIO files** (SPECTRA/HASYLAB, one scan per file): *Open folder...*, or *Open
|
|
167
|
+
file...* on one of them. Columns from the `Col` lines (first column named after `Scan_type`),
|
|
168
|
+
`%p` parameters as metadata, temperature columns for batch plots; files without data skipped.
|
|
169
|
+
* **SPEC files**, including the `.dat` files written by Bluesky: *Open file...*;
|
|
170
|
+
one scan per `#S`, labels from `#L`, X/Y/monitor from `#MD hints` when present.
|
|
171
|
+
* Multi-entry HDF5 / NeXus files (`.nxs`, `.nx5`, `.h5`, ...): each top-level group is a
|
|
172
|
+
scan; NeXus `@default/@signal/@axes` pick x and y (else the NXdata group), an NXmonitor
|
|
173
|
+
is the monitor, the NXsample temperature a temperature. *File > HDF5 tree* shows the file layout.
|
|
174
|
+
* ASCII columns, optional header; a 3rd column is offered as the error.
|
|
175
|
+
* Prev / Next step through the scans; the *step* field sets by how many (default 1).
|
|
176
|
+
* Optional monitor normalization (y/mon*norm). Errors default to sqrt(counts).
|
|
177
|
+
|
|
178
|
+
## Model (diffit conventions)
|
|
179
|
+
Each peak has height, center, hwhm. Background `bg0 + bg1*(x-xl) + bg2*(x-xl)^2`,
|
|
180
|
+
xl = left edge of the fit range. Up to 10 peaks, each with its own type.
|
|
181
|
+
|
|
182
|
+
| type | diffit | shape |
|
|
183
|
+
|---------|--------|-------|
|
|
184
|
+
| gauss | ga/gi | Gaussian |
|
|
185
|
+
| lorentz | lo | Lorentzian |
|
|
186
|
+
| lorsq | sl | Lorentzian squared |
|
|
187
|
+
| lorc | lc | Lorentzian convolved with Gaussian resolution (HW) |
|
|
188
|
+
| harm / harmc | ho | damped harmonic oscillator (harmc: with resolution) |
|
|
189
|
+
| power | po | height*(x-center)^hwhm above center |
|
|
190
|
+
| powerbelow | (new) | height*(center-x)^hwhm below center (order parameter vs T, center = T_c) |
|
|
191
|
+
| ba | ba | Blech-Averbach (x = Q, center = shell radius) |
|
|
192
|
+
| uf | uf | user function, any numpy expression in x, h, c, w, u1..u10 |
|
|
193
|
+
| pvoigt | (new) | pseudo-Voigt, eta = 0.5 |
|
|
194
|
+
| pvoigtf | (new) | pseudo-Voigt with free eta (4th parameter p<k>_shape) |
|
|
195
|
+
| pearson7 | (new) | Pearson VII, exponent m = shape (1 Lorentzian ... large Gaussian) |
|
|
196
|
+
| splitgauss | (new) | asymmetric Gaussian, HWHM w(1-a) left / w(1+a) right, a = shape |
|
|
197
|
+
| edge | (new) | knife-edge scan: erf step h/2*(1+erf(sqrt(ln2)*(x-c)/w)); beam FWHM = 2w (full width in the report) |
|
|
198
|
+
|
|
199
|
+
### Narrow + broad component on one peak
|
|
200
|
+
1. Estimate (N = 1) or Add a peak, then FIT.
|
|
201
|
+
2. Select it in the peak list, choose the type of the second component
|
|
202
|
+
(e.g. lorentz or lorsq), press **Add component**. The new peak sits at the same
|
|
203
|
+
position, 5x broader, 10x lower, with its center tied to the first peak
|
|
204
|
+
("component shares center"; untick to let it move).
|
|
205
|
+
3. FIT. Change the type of any peak by double-clicking its type in the peak list.
|
|
206
|
+
|
|
207
|
+
## diffit command to GUI
|
|
208
|
+
| diffit | pydiffit |
|
|
209
|
+
|---|---|
|
|
210
|
+
| GD, GD +/-/= | Open file, scan list, Prev/Next (with step), Reload |
|
|
211
|
+
| GD options AS, AP, MU, XA, AV, TA | Data > Transform / combine (sum, average, subtract, append another scan; x and y expressions; averaging) |
|
|
212
|
+
| WS weighting A/(sigma^2+B) | Weight A, B fields (diffit default was A=1, B=10; here B=0) |
|
|
213
|
+
| XR x1,x2,xe1,xe2,n... | Fit range min/max or Drag; Exclude (drag regions); Remove pts (click); Clear excl. (XR RES) |
|
|
214
|
+
| TC n,typ | per-peak type: peak list double-click, or Set type |
|
|
215
|
+
| ES n / ES -n | Estimate with N; "keep current peaks" = ES -N (adds peaks found in the residual) |
|
|
216
|
+
| OR | Up/Down buttons, Model > Reorder peaks |
|
|
217
|
+
| CP | double-click value/min/max; click vary column to fix/free |
|
|
218
|
+
| LC, LC CAN | expr column, right-click "Set equal to", "Constrain with expression"; Model > Cancel all constraints |
|
|
219
|
+
| (new) | right-click: fix/free all heights, centers, widths, background |
|
|
220
|
+
| HW hwhm, u1..u10 | Resolution HWHM field; Model > User function |
|
|
221
|
+
| BO A / BO D | Model > Bose / form factor; Data dialog "apply corrections to data" |
|
|
222
|
+
| FF A | Model > Bose / form factor (Brown <j0> coefficients, x = Q, s or 2theta) |
|
|
223
|
+
| LS urf,ll,n | FIT; method least squares or max. likelihood (Poisson, raw counts only); max evals |
|
|
224
|
+
| LR SS/FS | report panel (chi2, Rw, errors, integrals, strong correlations); File > Append report |
|
|
225
|
+
| LR RE | Add to results (fit panel), then Write fit results / Save CSV in the batch results window |
|
|
226
|
+
| SU | Fit > Summation |
|
|
227
|
+
| GP / WP | File > Load / Save parameters (JSON) |
|
|
228
|
+
| WD | File > Write data + fit |
|
|
229
|
+
| AF | Batch fit selected scans (start from previous result, same start values, a fresh estimate for every scan, or an estimate of the first scan followed by previous result or same start values). Results window: tick height/center/width/integral per peak in a grid (row and column "all" toggles), plus background, chi2 and column means; layouts: one panel per quantity, single plot, or normalized single plot; peaks matched between scans by position and width and numbered left to right; x = scan number, temperature (auto-detected sensor columns or SPEC #X header, with spread as x error bars) or any column; click a point to show that fit; table, CSV, save plot |
|
|
230
|
+
| PL, PL ALL, AX, SC, NX, NY, TI | plot updates live; Plot menu: log x/y, individual peaks, labels, autoscale; toolbar zoom |
|
|
231
|
+
|
|
232
|
+
Not ported: the Dorner kf^3 cot(theta) resolution-volume factor of BO (neutron
|
|
233
|
+
triple-axis only), the form-factor table file (FF L/P/D), and VMS/ILL-specific
|
|
234
|
+
commands (CY, FN, FE, DF, LI, SP, ZE, TP, FL).
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
Copyright (c) 2026, Jörg Strempfer.
|
|
239
|
+
pydiffit is licensed under the [Creative Commons Attribution 4.0 International
|
|
240
|
+
Public License](https://creativecommons.org/licenses/by/4.0/) (CC BY 4.0), see
|
|
241
|
+
[`LICENSE`](https://github.com/strempfer/pydiffit/blob/main/LICENSE).
|