Repository navigation
feat: Add structure subpackage - #4
cadenmyers13 wants to merge 3 commits into
Conversation
Port all 8 modules of diffpy.srfit.structure into diffpy.cmipdf.structure so cmipdf owns the structure adapters it depends on, and repoint basepdfgenerator at the local copy instead of diffpy.srfit.structure. Per the deprecation plan, cmipdf has never been released and so carries no deprecation shims: constrainAsSpaceGroup and the three setConst forwarders are dropped along with the diffpy.utils._deprecator imports, and the camelCase API is ported as snake_case only. getValue and addParameter stay camelCase because they override core srfit methods that have not been renamed yet; struToParameterSet keeps its name because srfit is not renaming it. Also add extend_path to src/diffpy/__init__.py, without which diffpy.cmipdf shadows the rest of the diffpy namespace. Tests ported from srfit for diffpyparset, objcrystparset and sgconstraints, minus the constrainAsSpaceGroup deprecation test, plus the LaMnO3.stru fixture and a pyobjcryst_available gate. Suite goes from 12 to 29 passing, matching srfit's 18 for the same modules less the one deprecation test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
==========================================
+ Coverage 87.11% 91.41% +4.30%
==========================================
Files 5 8 +3
Lines 194 769 +575
==========================================
+ Hits 169 703 +534
- Misses 25 66 +41
🚀 New features to boost your workflow:
|
|
@sbillinge ready for review |
sbillinge
left a comment
There was a problem hiding this comment.
I am not sure I understand what is going on here. What are the design decisions that have been made. Can we have a quick conversation about what the high level design is and make sure that this is what we want to be doing?
|
@sbillinge In my opinion, we could either (1) add it here as a subpackage ( |
|
I guess my question is what we can move from |
|
@sbillinge Here is my general understanding of these files. The files in the subpackage The file that gets used the most (I think) is These What would be ideal is to move To your point about the hypothetical The pros of having What do you think? |
|
Good analysis, let me think about it a bit |
|
I think that ideally srift wouldn't depend on structure and vice versa as in principle we want each to be used separately than the other. This meant that we would need the parameter adaptors to be elsewhere. The most logical place is presumably in cmipdf, cmirietveld etc. And we may need a cmistructure if it is used by both? But I am not sure. We could look in more folks too to discuss it? |
|
@sbillinge Creating a I think its okay to have it in |
|
closing as we will put this in https://github.com/diffpy/diffpy.cmistructure |
The
diffpy.srfit.structuresubpackage is dependent on the packages we are trying to eliminate from srfit, so I added it to this package.Because
getValueandaddParameterwere not deprecated on the last srfit release they remain camelcase for now. This will have to be updated upon the next srfit release