Skip to content
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

DEV: created filter objects with attenuation #25

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

brookeferber
Copy link
Contributor

No description provided.

@brookeferber
Copy link
Contributor Author

@CJ-Wright

xpdsim/filter.py Outdated
class Filter(be.Mover):
def __init__(self, name, fields, initial_set, attenuation, **kwargs):
self.attenuation = attenuation
super().__init__(name, fields, initial_set, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need empty line at the end of the file.

xpdsim/movers.py Outdated
@@ -2,3 +2,5 @@

shctl1 = be.Mover('shctl1', {'rad': lambda x: x}, {'x': 0})
cs700 = be.Mover('cs700', {'temperature': lambda x: x}, {'x': 300})


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra line

xpdsim/filter.py Outdated

def getAttenuation(self):
totalAttenuation = 1
for filter in self.filter_list:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use something other than filter for the name, it is a python built in.

xpdsim/filter.py Outdated
self.filter_list.append(f)
setattr(self, k, f)

def getAttenuation(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Methods are lower case with underscores as spaces.

xpdsim/filter.py Outdated
return totalAttenuation


class Filter(be.Mover):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid conflicts and confusion, can we change everywhere "filter" to either xrayfilter or beamfilter. Not sure which is better.

S

xpdsim/filter.py Outdated
print(self.read)
###########################################
position_info = self.read()
if (position_info.get('x') == 0):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put your print here

print('######################')
print(position_info)
print('######################')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! I'll do that now. Thank you.

@CJ-Wright CJ-Wright self-requested a review July 19, 2017 19:14
xpdsim/dets.py Outdated
imgs = ImageSequence(os.path.join(path, '*.tif*'), dtype=np.float64)
else:
imgs = [np.ones(path)]
imgs = ImageSequence(os.path.join(path, '*.tif*'), dtype=np.float64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line please

@codecov-io
Copy link

Codecov Report

Merging #25 into master will increase coverage by 3.71%.
The diff coverage is 98.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   93.54%   97.26%   +3.71%     
==========================================
  Files           6        8       +2     
  Lines         155      219      +64     
==========================================
+ Hits          145      213      +68     
+ Misses         10        6       -4
Impacted Files Coverage Δ
xpdsim/tests/test_dets.py 100% <100%> (ø) ⬆️
xpdsim/filter.py 100% <100%> (ø)
xpdsim/tests/test_filter.py 100% <100%> (ø)
xpdsim/dets.py 94.02% <94.44%> (+5.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update adfa6d7...b7cd3fa. Read the comment docs.

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