Skip to content

Commit 8a3ebd5

Browse files
Merge branch 'main' into scaleto
2 parents 5d07b9a + 77c0b9e commit 8a3ebd5

File tree

6 files changed

+88
-11
lines changed

6 files changed

+88
-11
lines changed

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,31 @@ assignees: ""
1212
- [ ] All the badges on the README are passing.
1313
- [ ] License information is verified as correct. If you are unsure, please comment below.
1414
- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are
15-
missing), tutorials, and other human written text is up-to-date with any changes in the code.
16-
- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated.
15+
missing), tutorials, and other human-written text is up-to-date with any changes in the code.
16+
- [ ] Installation instructions in the README, documentation, and the website (e.g., diffpy.org) are updated.
1717
- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version.
1818
- [ ] Grammar and writing quality are checked (no typos).
19+
- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release.
1920

2021
Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here:
2122

22-
### PyPI/GitHub full-release preparation checklist:
23-
- [ ] Create a new conda environment and install the rc from pypi (`pip install <package-name>=??`)
24-
- [ ] License information at Pypi is verified as correct.
25-
- [ ] Docs deployed successfully to `<package-name>.github.io`
26-
- [ ] Successfully run all tests, tutorial examples or do functional testing
23+
### PyPI/GitHub full-release preparation checklist:
2724

28-
Please let @sbillinge know that all checks are done and package is ready for full release.
25+
- [ ] Create a new conda environment and install the rc from PyPI (`pip install <package-name>==??`)
26+
- [ ] License information on PyPI is correct.
27+
- [ ] Docs are deployed successfully to `https://www.diffpy.org/<package-name>`.
28+
- [ ] Successfully run all tests, tutorial examples or do functional testing.
29+
30+
Please let @sbillinge know that all checks are done and the package is ready for full release.
2931

3032
### conda-forge release preparation checklist:
3133

3234
<!-- After @sbillinge releases the PyPI package, please check the following when creating a PR for conda-forge release.-->
3335

34-
- [ ] Ensure that the full release has appeared on Pypi successfully
36+
- [ ] Ensure that the full release has appeared on PyPI successfully.
3537
- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock.
36-
- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions
37-
- [ ] let @sbillinge and @bobleesj when this is ready
38+
- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions.
39+
- [ ] Tag @sbillinge and @bobleesj for conda-forge release.
3840

3941
### Post-release checklist
4042

news/config-UX.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* additional information to users to relieve frustration in finding how to update global config
20+
21+
**Security:**
22+
23+
* <news item>

news/deepcopy.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* copy() method for DiffractionObject instance
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

src/diffpy/utils/diffraction_objects.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,3 +448,14 @@ def dump(self, filepath, xtype=None):
448448
f.write(f"{key} = {value}\n")
449449
f.write("\n#### start data\n")
450450
np.savetxt(f, data_to_save, delimiter=" ")
451+
452+
def copy(self):
453+
"""
454+
Create a deep copy of the DiffractionObject instance.
455+
456+
Returns
457+
-------
458+
DiffractionObject
459+
A new instance of DiffractionObject, which is a deep copy of the current instance.
460+
"""
461+
return deepcopy(self)

src/diffpy/utils/tools.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ def _create_global_config(args):
8383
return_bool = False if username is None or email is None else True
8484
with open(Path().home() / "diffpyconfig.json", "w") as f:
8585
f.write(json.dumps({"username": stringify(username), "email": stringify(email)}))
86+
print(
87+
f"You can manually edit the config file at {Path().home() / 'diffpyconfig.json'} using any text editor.\n"
88+
f"Or you can update the config file by passing new values to get_user_info(), "
89+
f"see examples here: https://www.diffpy.org/diffpy.utils/examples/toolsexample.html"
90+
)
8691
return return_bool
8792

8893

tests/test_diffraction_objects.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,3 +533,16 @@ def test_all_array_setter():
533533
"Please use 'insert_scattering_quantity' to modify `all_arrays`.",
534534
):
535535
actual_do.all_arrays = np.empty((4, 4))
536+
537+
538+
def test_copy_object():
539+
do = DiffractionObject(
540+
name="test",
541+
wavelength=4.0 * np.pi,
542+
xarray=np.array([0.0, 90.0, 180.0]),
543+
yarray=np.array([1.0, 2.0, 3.0]),
544+
xtype="tth",
545+
)
546+
do_copy = do.copy()
547+
assert do == do_copy
548+
assert id(do) != id(do_copy)

0 commit comments

Comments
 (0)