Skip to content

Conversation

@jokasimr
Copy link
Contributor

@jokasimr jokasimr commented May 1, 2025

Adds more example files to be used in example notebook Nico is working on, slightly changes the interface to be able to access files from different years.

Comment on lines 86 to 87
def amor_run(number: int | str, year: int | str = 2024) -> Filename[SampleRun]:
return Filename[SampleRun](_pooch.fetch(f"amor{year}n{int(number):06d}.hdf"))
Copy link
Member

Choose a reason for hiding this comment

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

Why is the year needed? Aren't run number unique? At least that is what I have seen from other facilities.

Copy link
Contributor Author

@jokasimr jokasimr May 2, 2025

Choose a reason for hiding this comment

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

It was just simpler to implement that way. We could either rename the files to exclude the year, or list the files an find the one with matching run number. Do you think it's better to go with one of those approaches?

(That said, I don't know if the run numbers are unique or not. I've never seen duplicates, so I don't doubt they're unique if that is also your experience.)

Copy link
Member

Choose a reason for hiding this comment

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

Well, if the year is required these functions are essentially unusable without looking into the source code, right? Unless you did the experiment yourself and remember what year it was in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the year argument

"# The sample rotation value in the file is slightly off, so we set it manually\n",
"workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n",
"workflow[Filename[ReferenceRun]] = amor.data.amor_reference_run()\n",
"workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n",
Copy link
Member

Choose a reason for hiding this comment

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

Above you passed runs as string, but an int here? Should it all be ints?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both work but I agree it's better to be consistent.

@jokasimr jokasimr merged commit f1c083c into main May 2, 2025
4 checks passed
@jokasimr jokasimr deleted the update-example-files branch May 2, 2025 08:40
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.

3 participants