-
Notifications
You must be signed in to change notification settings - Fork 2
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
Migrate to copier #159
Migrate to copier #159
Conversation
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.
Great, thank you! Couple of comments, some of which are more related to general code issues that to this change so feel free to ignore/spin out
.copier-answers.yml
Outdated
package_name: mx_bluesky | ||
pypi: true | ||
repo_name: mx_bluesky |
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.
Could: I can't find the discussion now but I think @callumforrester convinced me that we should be using hyphens rather than underscores in our package names. Is this a good opportunity to fix this here?
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.
It's in PEP8
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.
great, I wanted to do that but didn't want to have a fight about it
# The devcontainer should use the developer target and run as root with podman | ||
# or docker with user namespaces. | ||
ARG PYTHON_VERSION=3.11 | ||
FROM python:${PYTHON_VERSION} as developer |
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.
I made DiamondLightSource/python-copier-template#188 for this warning
@@ -251,22 +248,24 @@ def save_screen_map() -> MsgGenerator: | |||
|
|||
@log.log_on_entry | |||
def upload_parameters( | |||
chipid: str = "oxford", | |||
pmac: PMAC = inject("pmac"), | |||
chipid: str = "oxford", pmac: PMAC = inject("pmac"), width: int | None = None |
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.
Could: It looks like upload_parameters
is only ever called with oxford
. If we don't use any other chips a better fix here would be to not even take the chip type as an argument and just hardcode oxford and width=8? Pull into a separate issue if we're not sure
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.
For this and other similar, I didn't want to change things beyond the minimum necessary to make pyright happy here, but I agree these things all need cleaning up
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 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.
Thanks!
@@ -79,36 +79,36 @@ def plot_file(fid, chip_type): | |||
ax1.set_xlim(-1, 26) | |||
ax1.set_ylim(-1, 26) | |||
ax1.invert_yaxis() | |||
check_files(["%s.png" % chip_type]) | |||
plt.savefig("%s.png" % fid[:-5], dpi=200, bbox_inches="tight", pad_inches=0.05) | |||
check_files("i24", [f"{chip_type}.png"]) |
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.
Could: check_files
only ever uses i24
as a location, maybe this because they change the hardcoded location to something else when they do it at the xfel? If that is the case we need a clean way for them to change it rather than have to go through every location? If not the case why pass a location to it at all. Maybe new issue?
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.
elif chip_type == ChipType.Custom: | ||
# No fiducial for custom |
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.
Should: What does this comment give you over the existing log?
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.
I didn't add this comment, just moved it down two lines so it was in the section it referred to
tests/i04/test_thawing.py
Outdated
time: float | Literal[10] | Literal[50], | ||
rotation: Literal[360] | Literal[100] | Literal[-100], | ||
expected_speed: ApproxBase | Literal[72] | Literal[4], |
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.
Should: This odd, if I want to add another case to the parameterize I need to change these types? I feel like they should just be floats/ints?
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.
hah, I guess ruff added these automagically
@@ -29,7 +29,7 @@ | |||
|
|||
|
|||
async def test_arm_and_disarm_zebra(zebra: Zebra, RE): | |||
zebra.pc.arm.TIMEOUT = 1 | |||
zebra.pc.arm.TIMEOUT = 1 # type: ignore |
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.
Could: I feel like the correct answer is to change the definition to be TIMEOUT: float = 3
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.
8658b26
to
ad47831
Compare
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.
Thanks, I think you were slightly too aggressive on the find/replace. Otherwise good.
docs/developer/serial-crystallography-on-i24/how-to/run-a-collection.rst
Outdated
Show resolved
Hide resolved
docs/developer/serial-crystallography-on-i24/how-to/run-a-collection.rst
Outdated
Show resolved
Hide resolved
docs/developer/serial-crystallography-on-i24/how-to/stage-pmac-moves.rst
Outdated
Show resolved
Hide resolved
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.
Great, thank you!
To test: