-
Notifications
You must be signed in to change notification settings - Fork 7
skpkg: setup CI after migrating tests, src, requirements, and .github folder #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
080fc8f
skpkg: mirate src folder
tinatn29 20f3744
skpkg: migrate tests folder
tinatn29 94b2c15
skpkg: list dependencies in requirements folder
tinatn29 21a9d1a
skpkg: add CI and issue/PR templates
tinatn29 f345477
skpkg: add pyproject.toml
tinatn29 ce5481f
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] 9724841
edit date range
tinatn29 a71c6e1
Merge branch 'setup-CI' of https://github.com/tinatn29/diffpy.fourigu…
tinatn29 a99fd86
add tests-on-pr back from main
tinatn29 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ __pycache__/ | |
.Python | ||
env/ | ||
build/ | ||
_build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
sphinx | ||
sphinx_rtd_theme | ||
sphinx-copybutton | ||
doctr | ||
m2r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/env python | ||
############################################################################## | ||
# | ||
# (c) 2022-2025 The Trustees of Columbia University in the City of New York. | ||
# (c) 2025 The Trustees of Columbia University in the City of New York. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. date range |
||
# All rights reserved. | ||
# | ||
# File coded by: Billinge Group members and community contributors. | ||
# File coded by: Billinge Group members. | ||
# | ||
# See GitHub contributions for a more detailed list of contributors. | ||
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors | ||
|
@@ -15,7 +15,7 @@ | |
"""Tool for visualizing 3D diffraction and PDF images.""" | ||
|
||
# package version | ||
from diffpy.fourigui.version import __version__ | ||
from diffpy.fourigui.version import __version__ # noqa | ||
|
||
# silence the pyflakes syntax checker | ||
assert __version__ or True | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import numpy as np | ||
|
||
|
||
def dot_product(a, b): | ||
"""Compute the dot product of two vectors of any size. | ||
|
||
Ensure that the inputs, a and b, are of the same size. | ||
The supported types are "array_like" objects, which can | ||
be converted to a NumPy array. Examples include lists and tuples. | ||
|
||
Parameters | ||
---------- | ||
a : array_like | ||
The first input vector. | ||
b : array_like | ||
The second input vector. | ||
|
||
Returns | ||
------- | ||
float | ||
The dot product of the two vectors. | ||
|
||
Examples | ||
-------- | ||
Compute the dot product of two lists: | ||
>>> a = [1, 2, 3] | ||
>>> b = [4, 5, 6] | ||
>>> dot_product(a, b) | ||
32.0 | ||
""" | ||
return float(np.dot(a, b)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/usr/bin/env python | ||
############################################################################## | ||
# | ||
# (c) 2022-2025 The Trustees of Columbia University in the City of New York. | ||
# (c) 2025 The Trustees of Columbia University in the City of New York. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. date |
||
# All rights reserved. | ||
# | ||
# File coded by: Billinge Group members and community contributors. | ||
# File coded by: Billinge Group members. | ||
# | ||
# See GitHub contributions for a more detailed list of contributors. | ||
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors | ||
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors # noqa: E501 | ||
# | ||
# See LICENSE.rst for license information. | ||
# | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from diffpy.fourigui import functions # noqa | ||
|
||
|
||
def test_dot_product_2D_list(): | ||
a = [1, 2] | ||
b = [3, 4] | ||
expected = 11.0 | ||
actual = functions.dot_product(a, b) | ||
assert actual == expected | ||
|
||
|
||
def test_dot_product_3D_list(): | ||
a = [1, 2, 3] | ||
b = [4, 5, 6] | ||
expected = 32.0 | ||
actual = functions.dot_product(a, b) | ||
assert actual == expected | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"a, b, expected", | ||
[ | ||
# Test whether the dot product function works with 2D and 3D vectors | ||
# C1: lists, expect correct float output | ||
([1, 2], [3, 4], 11.0), | ||
([1, 2, 3], [4, 5, 6], 32.0), | ||
# C2: tuples, expect correct float output | ||
((1, 2), (3, 4), 11.0), | ||
((1, 2, 3), (4, 5, 6), 32.0), | ||
# C3: numpy arrays, expect correct float output | ||
(np.array([1, 2]), np.array([3, 4]), 11.0), | ||
(np.array([1, 2, 3]), np.array([4, 5, 6]), 32.0), | ||
], | ||
) | ||
def test_dot_product(a, b, expected): | ||
actual = functions.dot_product(a, b) | ||
assert actual == expected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would like to keep the full date range here, so 2022-2025