Skip to content

Conversation

@bnmajor
Copy link
Collaborator

@bnmajor bnmajor commented Dec 10, 2025

No description provided.

@bnmajor bnmajor requested review from psavery and saransh13 December 10, 2025 21:47
@psavery
Copy link
Collaborator

psavery commented Dec 12, 2025

Code looks good to me. Can you review, @saransh13?

@psavery
Copy link
Collaborator

psavery commented Jan 5, 2026

This was rebased on master

@saransh13
Copy link
Member

saransh13 commented Jan 5, 2026

I think there is some formatting issue with the atom coordinates. The square brackets need to be removed:

_atom_site_label [Ti0]
_atom_site_type_symbol [Ti]
_atom_site_fract_x [0.33333334]
_atom_site_fract_y [0.66666669]
_atom_site_fract_z [0.25000000]
_atom_site_occupancy [1.00000000]

If there are multiple atoms present, then we need to loop over those and write the atom coordinates separately. Example cif file with multiple atoms below

loop_
_atom_site_label
_atom_site_type_symbol
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
_atom_site_symmetry_multiplicity
_atom_site_Wyckoff_symbol
_atom_site_attached_hydrogens
_atom_site_calc_flag
_atom_site_thermal_displace_type
_atom_site_u_iso_or_equiv
C1 C -0.4668  0.1651  0.2568 ? 2 i ? d ? ?
C2 C -0.6267  0.0026  0.2487 ? 2 i ? d ? ?
C3 C -0.7850  0.0073  0.2487 ? 2 i ? d ? ?
C4 C -0.7856  0.1667  0.2511 ? 2 i ? d ? ?
C5 C -0.6240  0.3218  0.2442 ? 2 i ? d ? ?
C6 C -0.4621  0.3268  0.2520 ? 2 i ? d ? ?
H1 H -0.5330 -0.1430  0.2380 ? 2 i ? d ? ?
H2 H -0.7200 -0.2320  0.2600 ? 2 i ? d ? ?
H3 H -1.0170  0.0910  0.2540 ? 2 i ? d ? ?
H4 H -0.9290  0.2880  0.2540 ? 2 i ? d ? ?
H5 H -0.3180  0.5640  0.2440 ? 2 i ? d ? ?
H6 H -0.2210  0.4540  0.2240 ? 2 i ? d ? ?
N1 N -0.3079  0.1683  0.2695 ? 2 i ? d ? ?
N2 N -0.6307 -0.1466  0.2389 ? 2 i ? d ? ?
N3 N -0.9435 -0.1493  0.2467 ? 2 i ? d ? ?
N4 N -0.9290  0.1722  0.2578 ? 2 i ? d ? ?
N5 N -0.6253  0.4763  0.2350 ? 2 i ? d ? ?
N6 N -0.3158  0.4709  0.2517 ? 2 i ? d ? ?
O1 O -0.1665  0.3069  0.2820 ? 2 i ? d ? ?
O2 O -0.3073  0.0297  0.2641 ? 2 i ? d ? ?
O3 O -0.9488 -0.2919  0.2377 ? 2 i ? d ? ?
O4 O -1.0811 -0.1499  0.2525 ? 2 i ? d ? ?
O5 O -0.7620  0.4789  0.2304 ? 2 i ? d ? ?
O6 O -0.4869  0.6175  0.2357 ? 2 i ? d ? ?

@saransh13
Copy link
Member

The other thing that should be fixed is that the apple export menu says open instead of save.

image

@bnmajor
Copy link
Collaborator Author

bnmajor commented Jan 6, 2026

The other thing that should be fixed is that the apple export menu says open instead of save.

@saransh13 Would you prefer to get the "save file as" prompt when a single material is exported? For multiple selections we would keep the current approach of just having them select the directory to write out to.

@saransh13
Copy link
Member

Ok, yes. That seems like a reasonable solution.

Signed-off-by: Brianna Major <brianna.major@kitware.com>
Signed-off-by: Brianna Major <brianna.major@kitware.com>
Signed-off-by: Brianna Major <brianna.major@kitware.com>
@bnmajor
Copy link
Collaborator Author

bnmajor commented Jan 12, 2026

I think there is some formatting issue with the atom coordinates. The square brackets need to be removed:[...]

If there are multiple atoms present, then we need to loop over those and write the atom coordinates separately. Example cif file with multiple atoms below [...]

These formatting fixes are in HEXRD/hexrd#874

Allow naming for single-file selections and directory selection for
multi-file exports.

Signed-off-by: Brianna Major <brianna.major@kitware.com>
@saransh13
Copy link
Member

@bnmajor There is one change and one enhancement in this PR. The enhancement can be a separate PR.
For the change, there is still All blocks output. printed to the terminal and in the message box. Can you suppress that. I will approve and you can merge after this change.

For the enhancement (future PR), we can

  • get rid of the indent here:
image
  • include the _atom_site_U_iso or _atom_site_U_aniso key in the loop. This will write the mean-squared atom displacement or the Debye-Waller factor.

@bnmajor
Copy link
Collaborator Author

bnmajor commented Jan 12, 2026

@bnmajor There is one change and one enhancement in this PR. The enhancement can be a separate PR. For the change, there is still All blocks output. printed to the terminal and in the message box. Can you suppress that. I will approve and you can merge after this change.

This seems to come from the CifFile library I'll see if I can suppress it.

For the enhancement (future PR), we can

  • get rid of the indent here:
image * include the `_atom_site_U_iso` or `_atom_site_U_aniso` key in the loop. This will write the mean-squared atom displacement or the Debye-Waller factor.

I'm going to break this out into a new issue so we can discuss further. I'll need clarification on a few things.

@bnmajor
Copy link
Collaborator Author

bnmajor commented Jan 12, 2026

There is one change and one enhancement in this PR. The enhancement can be a separate PR. For the change, there is still All blocks output. printed to the terminal and in the message box. Can you suppress that. I will approve and you can merge after this change.

@saransh13 This is suppressed in HEXRD/hexrd@41e8046

@bnmajor bnmajor merged commit b2ec01e into master Jan 13, 2026
10 checks passed
@bnmajor bnmajor deleted the cif-export branch January 13, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants