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

feat: add arguments for 3D OTF generation #57

Merged
merged 27 commits into from
Jul 20, 2024

Conversation

zichenzachwang
Copy link
Contributor

Allow 3D OTF generation after changes have been added to radial_interface.cpp in cudadecon

@tlambert03
Copy link
Owner

hey @zichenzachwang, I need your help in resolving conflicts (in the future, please create a personal branch for PRs, rather than using your main branch).

please change makeOTF to:

if lib.version and lib.version < (0, 7):
    @otf_lib.function
    def makeOTF(
        ifiles: bytes,
        ofiles: bytes,
        lambdanm: int = 520,
        dz: float = 0.102,
        interpkr: int = 10,
        bUserBackground: bool = False,
        background: float = 90,
        NA: float = 1.25,
        NIMM: float = 1.3,
        dr: float = 0.102,
        krmax: int = 0,
        bDoCleanup: bool = False,
    ) -> None:
        """Make OTF file(s) from `ifiles`, write to `ofiles`."""

else:
    
    @otf_lib.function
    def makeOTF(
        ifiles: bytes,
        ofiles: bytes,
        lambdanm: int = 520,
        dz: float = 0.102,
        interpkr: int = 10,
        bUserBackground: bool = False,
        background: float = 90,
        NA: float = 1.25,
        NIMM: float = 1.3,
        dr: float = 0.102,
        krmax: int = 0,
        bDoCleanup: bool = False,
        b3Dout: bool = False,
    ) -> None:
        """Make OTF file(s) from `ifiles`, write to `ofiles`."""

and then resolve conflicts on the other docstrings

@tlambert03 tlambert03 changed the title add arguments for 3D OTF generation feat: add arguments for 3D OTF generation Jul 19, 2024
@zichenzachwang
Copy link
Contributor Author

hey @zichenzachwang, I need your help in resolving conflicts (in the future, please create a personal branch for PRs, rather than using your main branch).

please change makeOTF to:

if lib.version and lib.version < (0, 7):
    @otf_lib.function
    def makeOTF(
        ifiles: bytes,
        ofiles: bytes,
        lambdanm: int = 520,
        dz: float = 0.102,
        interpkr: int = 10,
        bUserBackground: bool = False,
        background: float = 90,
        NA: float = 1.25,
        NIMM: float = 1.3,
        dr: float = 0.102,
        krmax: int = 0,
        bDoCleanup: bool = False,
    ) -> None:
        """Make OTF file(s) from `ifiles`, write to `ofiles`."""

else:
    
    @otf_lib.function
    def makeOTF(
        ifiles: bytes,
        ofiles: bytes,
        lambdanm: int = 520,
        dz: float = 0.102,
        interpkr: int = 10,
        bUserBackground: bool = False,
        background: float = 90,
        NA: float = 1.25,
        NIMM: float = 1.3,
        dr: float = 0.102,
        krmax: int = 0,
        bDoCleanup: bool = False,
        b3Dout: bool = False,
    ) -> None:
        """Make OTF file(s) from `ifiles`, write to `ofiles`."""

and then resolve conflicts on the other docstrings

Hi Talley,

Thanks for mentioning that. I created a personal branch. Changes have been added. I also added to otf.py:

with CappedPSF(psf, max_otf_size) as _psf:
        args = [
            str.encode(_psf.path),
            str.encode(outpath),
            wavelength,
            dzpsf,
            fixorigin,
            bUserBackground,
            background,
            na,
            nimm,
            dxpsf,
            krmax,
            cleanup_otf,
        ]

        if not lib.lib.version or lib.lib.version >= (0, 7):
            args += [skewed_decon]

        lib.makeOTF(*args)  # type: ignore

There is just one last issue with typo check. It tries to correct b3Dout argument name but I used it to be consistent with cudadecon.

@tlambert03
Copy link
Owner

Thanks @zichenzachwang

For the typo issue, add the string to the list of extend-ignore-identifiers-re at the bottom of pyproject.toml

@zichenzachwang
Copy link
Contributor Author

Got it. Ready to merge!

@tlambert03 tlambert03 merged commit 78ef027 into tlambert03:main Jul 20, 2024
2 checks passed
@zichenzachwang zichenzachwang deleted the allow-3D-OTF branch July 21, 2024 19: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.

2 participants