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

API changes before 1.0 #231

Open
35 tasks
sroet opened this issue Sep 27, 2024 · 0 comments
Open
35 tasks

API changes before 1.0 #231

sroet opened this issue Sep 27, 2024 · 0 comments

Comments

@sroet
Copy link
Collaborator

sroet commented Sep 27, 2024

This is the list of new API changes that we want to implement before cutting a 1.0 release

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/angles.py:

  • Change load_angle_list and angle_to_angle_list to private

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/correlation.py

  • make normalise and normalised_cross_correlation private (maybe even split out to test only utils)

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/extract.py

def _predict_tophat_mask(
    score_volume: npt.NDArray[float],
    n_false_positives: float = 1.0,
    tophat_connectivity: int = 1,
    bins: int = 50,
    create_plot: bool = True,
    output_path_plot: Optional[pathlib.Path] = None,
)
  • split gauss and log_gauss into a utils and also use these inside plotting
  • alter extract_particles to
def extract_particles(
    job: TMJob,
    particle_radius_px: int,
    n_particles: int,
    cut_off: Optional[float] = None,
    n_false_positives: float = 1.0,
    relion5_compat: bool = False,
    tophat_filter: bool = False,
    tophat_connectivity: int = 1,
    tophat_bins: int = 50,
    tomogram_mask_path: Optional[pathlib.Path] = None,
    ignore_tomogram_mask: bool = False,
    create_plot: bool = True,
    plot_bins: int = 20,
) -> tuple[pd.DataFrame, list[float, ...]]:

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/io.py

  • pull out all argparse checkers to a seperate file
  • move UnequalSpacingError to utils
  • remove write_angle_list
  • make read_txt_file private
  • make read_imod_defocus_file private

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/matching.py

  • make std_under_mask_convolution private

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/parallel.py

  • make gpu_runner private

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/plotting.py

  • remove check_square_fdr
  • remove distance_to_diag
  • remove calculate_histogram
  • remove evaluate_estimates
  • remove fdr_recall
  • remove distance_to_random
  • remove get_distance
  • move gauss, gauss_integral and bimodal to utils
  • add typing and docstring to plist_quality_gaussian_fit (@McHaillet )

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/tmjob.py

    def __init__(
        self,
        job_key: str,
        log_level: int,
        tomogram: pathlib.Path,
        template: pathlib.Path,
        mask: pathlib.Path,
        output_dir: pathlib.Path,
        angle_increment: Optional[Union[str, float]] = None,
        particle_diameter: Optional[float] = None,
        rotational_symmetry: int = 1,
        mask_is_spherical: bool = True,
        voxel_size: Optional[float] = None,
        low_pass: Optional[float] = None,
        high_pass: Optional[float] = None,
	tilt_angles: Optional[list[float, ...]] = None,
        tilt_weighting: bool = False,
        dose_accumulation: Optional[list[float, ...]] = None,
        ctf_data: Optional[list[dict, ...]] = None,
        defocus_handedness: int = 0,
        search_x: Optional[list[int, int]] = None,
        search_y: Optional[list[int, int]] = None,
        search_z: Optional[list[int, int]] = None,
        tomogram_mask: Optional[pathlib.Path] = None,
        whiten_spectrum: bool = False,
        random_phase_correction: bool = False,
        rng_seed: int = 321,
        output_dtype: np.dtype = np.float32,
        job_loaded_for_extraction: bool = False,
        pytom_tm_version_number: str = PYTOM_TM_VERSION,
    ):

https://github.com/SBC-Utrecht/pytom-match-pick/blob/main/src/pytom_tm/weights.py

  • make hwhm_to_sigma private

  • remove sigma_to_hwhm

  • make wavelength_ev2m private

  • think about restructuring ‎create_gaussian_high_pass and ‎create_gaussian_low_pass (lot of code duplication)

  • make sure create_gaussian_band_pass is the only public gaussian_*_pass function, rewrite other files to use this instead

  • make create_ctf private and update docstring in

    pytom_tm.weight.create_ctf() for parameter definition

  • make radial_average private

  • update version number

  • up test coverage to 100%

  • make release

  • drop packages following SPEC0/NEP29

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

No branches or pull requests

1 participant