-
Notifications
You must be signed in to change notification settings - Fork 31
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
Miscellaneous changes to pyat #103
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
9a0c2f2
Ohmi_envelope and test_matlab changes.
T-Nicholls 7ed8cd8
Rearrange pyat README.
T-Nicholls 7268a9b
Add check that PassMethod exists.
T-Nicholls 8f706d5
Fix typos in test_matlab/README.rst
T-Nicholls 6c38f8f
Update tests to support new PassMethod existence check.
T-Nicholls 6e5442a
Fix Matlab comparison test failures and simplify pyAT install instruc…
T-Nicholls 5a311b0
Ensure radiation state for lattice call of get_mcf.
T-Nicholls 6fe7b64
Add another pass method check and remove last multi_dot useage.
T-Nicholls 5b5318a
Add tests for new element methods.
T-Nicholls 83b933d
Add tests for lattice object creation.
T-Nicholls 6ea36fe
Add tests for the rest of the public lattice object methods.
T-Nicholls a8bc5dc
Changes to str and repr methods and add some more tests.
T-Nicholls 94f2f16
Move all test fixtures to conftest and set their scope to session.
T-Nicholls 239ec10
Add new get elements method to get elements by family or class.
T-Nicholls 8c2f8e0
Fix failing tests for python 3 versions and numpy < 1.13 versions.
T-Nicholls 7a08a3f
Various suggested ammendments.
T-Nicholls 461ed53
Move updated get_elements to lattice.utils and add a test for it.
T-Nicholls c7ba30f
Revert energy guessing change to lattice object to keep support for i…
T-Nicholls 94a355e
Update tests for get_ring_energy.
T-Nicholls 010f072
Add quiet parameter to get_elements to suppress the print statement.
T-Nicholls 1b2e255
Merge changes from #102 and resolve conflicts.
T-Nicholls 33e5dfc
Add final few tests for lattice object and other minor changes.
T-Nicholls ecacabb
Split up lattice obect tests and make pass method checking more robust.
T-Nicholls 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 contains 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 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 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 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 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 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,4 @@ | ||
pytest>=2.9 | ||
numpy>=1.13 | ||
numpy>=1.10 | ||
scipy>=0.16 | ||
pytest-lazy-fixture |
This file contains 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.
There is a problem here:
I made significant modifications to
lattice_object
in theplot_preparation
branch. To avoid unnecessarylist
copies (build alist
first, and then give it tosuper(Lattice, self).__init__
, thelist
constructor, which will itself build a copy of thislist
),full_scan
now accepts any iterable as input and returns an iterator over the elements. So it is executed withinsuper(Lattice, self).__init__
. The gain is most effective when the input tofull_scan
is itself an iterator. In such a case, after the first loop over elements,get_ring_energy
will get an empty iterator, and fail.Example: we have a Lattice
ring
, withoutRingParam
element but with anRFCavity
giving the energy. Let's assume we want to filter this lattice with some condition:ring2=Lattice([elem for elem in ring if <some condition>])
Here we build a list first, which will be copied by the list constructor.
get_ring_energy
will work.ring2=Lattice(elem for elem in ring if <some condition>)
Here we have no intermediate list,
<some condition>
will be tested within the list constructor andget_ring_energy
will fail.I think we should keep the possibility of accepting any iterable (sequence or iterator) as input, not only a sequence.
For the time being, I suggest to keep lattice_object unchanged to avoid merging problems. Keep all your other modifications as they are, let's merge both branches and start over then with this code factorisation.
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.
Ok, I will revert the modifications to
lattice_object
for now. Yes, I am learning that working on multiple branches at once is a recipe for problems, the test on #102 is failing because it relies on changes made here.