Skip to content

Commit

Permalink
Merge pull request #3 from rs-station/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
kmdalton authored Jul 21, 2024
2 parents cbf623a + e682c54 commit c0d2f5c
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 42 deletions.
Empty file.
2 changes: 1 addition & 1 deletion abismal/abismal.py → abismal/command_line/abismal.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

def main():
from abismal.parser import parser
from abismal.command_line.parser import parser
parser = parser.parse_args()

from abismal.io.tf_settings import set_log_level, set_gpu
Expand Down
38 changes: 38 additions & 0 deletions abismal/command_line/parser/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
ABISMAL - merge serial diffraction data using neural networks and variational inference.
"""

import abismal.command_line.parser.io as io
import abismal.command_line.parser.architecture as architecture
import abismal.command_line.parser.likelihood as likelihood
import abismal.command_line.parser.optimizer as optimizer
import abismal.command_line.parser.phenix as phenix
import abismal.command_line.parser.priors as priors
import abismal.command_line.parser.ray as ray
import abismal.command_line.parser.surrogate_posterior as surrogate_posterior
import abismal.command_line.parser.tf as tf
import abismal.command_line.parser.training as training

groups = [
architecture,
io,
likelihood,
optimizer,
phenix,
priors,
ray,
surrogate_posterior,
tf,
training,
]

from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
for group in groups:
g = parser.add_argument_group(group.title, group.description)
for args,kwargs in group.args_and_kwargs:
g.add_argument(*args, **kwargs)

all = [
parser,
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title = "Priors"
description = "Arguments governing the prior distributions"

from abismal.parser.custom_types import list_of_ints,list_of_ops,list_of_floats
from abismal.command_line.parser.custom_types import list_of_ints,list_of_ops,list_of_floats

args_and_kwargs = (
(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion abismal/io/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_dataset(self, peak_list_columns=None, **ray_kwargs):
'ewald_offset_x', 'ewald_offset_y', 'ewald_offset_z',
]

chunks = self.parallel_read_crystfel(
chunks = self.read_crystfel(
wavelength=self.wavelength,
peak_list_columns=peak_list_columns,
**ray_kwargs,
Expand Down
38 changes: 0 additions & 38 deletions abismal/parser/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def getVersionNumber():
tests_require=['pytest', 'pytest-cov', 'pytest-xdist'],
entry_points={
"console_scripts": [
"abismal=abismal.abismal:main",
"abismal=abismal.command_line.abismal:main",
]
},
)

0 comments on commit c0d2f5c

Please sign in to comment.