Skip to content

Commit

Permalink
Back to smops
Browse files Browse the repository at this point in the history
  • Loading branch information
Mulan-94 committed Sep 14, 2022
1 parent 770da78 commit bf8b522
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* sade version:
* smops version:
* Python version:
* Operating System:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
python-vresion: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install sade
- name: Install smops
run: |
python -m pip install --upgrade pip
pip install .
sade -v
smops -v
24 changes: 12 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/mulan-94/sade/issues.
Report bugs at https://github.com/mulan-94/smops/issues.

If you are reporting a bug, please include:

Expand All @@ -38,14 +38,14 @@ and "help wanted" is open to whoever wants to implement it.
Write Documentation
~~~~~~~~~~~~~~~~~~~

sade could always use more documentation, whether as part of the
official sade docs, in docstrings, or even on the web in blog posts,
smops could always use more documentation, whether as part of the
official smops docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/mulan-94/sade/issues.
The best way to send feedback is to file an issue at https://github.com/mulan-94/smops/issues.

If you are proposing a feature:

Expand All @@ -57,17 +57,17 @@ If you are proposing a feature:
Get Started!
------------

Ready to contribute? Here's how to set up `sade` for local development.
Ready to contribute? Here's how to set up `smops` for local development.

1. Fork the `sade` repo on GitHub.
1. Fork the `smops` repo on GitHub.
2. Clone your fork locally::

$ git clone [email protected]:your_name_here/sade.git
$ git clone [email protected]:your_name_here/smops.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv sade
$ cd sade/
$ mkvirtualenv smops
$ cd smops/
$ python setup.py develop

4. Create a branch for local development::
Expand All @@ -79,7 +79,7 @@ Ready to contribute? Here's how to set up `sade` for local development.
5. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::

$ flake8 sade tests
$ flake8 smops tests
$ python setup.py test or pytest
$ tox

Expand All @@ -103,15 +103,15 @@ Before you submit a pull request, check that it meets these guidelines:
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
https://travis-ci.com/mulan-94/sade/pull_requests
https://travis-ci.com/mulan-94/smops/pull_requests
and make sure that the tests pass for all supported Python versions.

Tips
----

To run a subset of tests::

$ pytest tests.test_sade
$ pytest tests.test_smops


Deploying
Expand Down
1 change: 0 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ History

0.1.2 (2022-09-14)
------------------
* Change name from smops to sade
* Added `output-prefix` argument
* Removed `output-dir` argument

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache

lint/flake8: ## check style with flake8
flake8 sade tests
flake8 smops tests

lint: lint/flake8 ## check style

Expand All @@ -59,15 +59,15 @@ test-all: ## run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
coverage run --source sade -m pytest
coverage run --source smops -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/sade.rst
rm -f docs/smops.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ sade
sphinx-apidoc -o docs/ smops
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
=====
sade
smops
=====


.. image:: https://img.shields.io/pypi/v/sade.svg
:target: https://pypi.python.org/pypi/sade
.. image:: https://img.shields.io/pypi/v/smops.svg
:target: https://pypi.python.org/pypi/smops


sade (aka Smooth Operator) is a python package for interpolating channelised FITS model images onto user-specified higher resolution frequency grid. For example, you can give sade a set of 4 per-subband model FITS images, and ask it to return 16 model images, which can then be fed back into e.g. wsclean_ for a predict operation. Usage:
smops (aka Smooth Operator) is a python package for interpolating channelised FITS model images onto user-specified higher resolution frequency grid. For example, you can give smops a set of 4 per-subband model FITS images, and ask it to return 16 model images, which can then be fed back into e.g. wsclean_ for a predict operation. Usage:

.. code-block:: bash
sade --ms /ms/used/togen/images.ms -ip prefix-used-for-those-images -co 16 -order 4
smops --ms /ms/used/togen/images.ms -ip prefix-used-for-those-images -co 16 -order 4
Its options are:

.. code-block:: python
usage: sade [-h] [-v] [-op] [-j] [-s] [-mem] -ms -ip -co [-order]
usage: smops [-h] [-v] [-op] [-j] [-s] [-mem] -ms -ip -co [-order]
Refine model images in frequency
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# https://setuptools.pypa.io/en/latest/userguide/declarative_config.html?
# https://setuptools.pypa.io/en/latest/references/keywords.html
[metadata]
name = sade
version = attr: sade.VERSION
name = smops
version = attr: smops.VERSION
author = L. Andati
email = [email protected]
description = Python script for interpolating FITS model images over frequency
long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst
keywords = sade, model frequency interpolation, FITS images
keywords = smops, model frequency interpolation, FITS images
license = MIT license
license_files = file: LICENSE.rst
url = https://github.com/mulan-94/smops
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
setup(
entry_points={
'console_scripts': [
'sade=sade.smooth:main',
'smops=smops.smooth:main',
],
},
packages=find_packages(include=['sade', 'sade.*']),
packages=find_packages(include=['smops', 'smops.*']),
)
2 changes: 1 addition & 1 deletion sade/__init__.py → smops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Top-level package for sade."""
"""Top-level package for smops."""

__author__ = AUTHOR = """L Andati"""
__email__ = EMAIL = '[email protected]'
Expand Down
10 changes: 5 additions & 5 deletions sade/smooth.py → smops/smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


from dask import compute
from sade import VERSION
from smops import VERSION


GB = 2**30
Expand All @@ -32,15 +32,15 @@ def configure_logger(out_dir="."):
os.makedirs(out_dir)

l_handler = logging.FileHandler(
os.path.join(out_dir, "sade.log"), mode="w")
os.path.join(out_dir, "smops.log"), mode="w")
l_handler.setLevel(logging.INFO)
l_handler.setFormatter(formatter)

s_handler = logging.StreamHandler()
s_handler.setLevel(logging.INFO)
s_handler.setFormatter(formatter)

logger = logging.getLogger("sade")
logger = logging.getLogger("smops")
logger.setLevel(logging.INFO)

logger.addHandler(l_handler)
Expand All @@ -52,10 +52,10 @@ def get_arguments():
parser = argparse.ArgumentParser(description="Refine model images in frequency")
parser.add_argument("-v", "--version", action='version', version=f'%(prog)s {VERSION}')
# parser.add_argument("-od", "--output-dir", dest="output_dir",
# default="sade-output", metavar="",
# default="smops-output", metavar="",
# help="Where to put the output files.")
parser.add_argument("-op", "--output-prefix", dest="output_pref",
default="sade-interp-model", metavar="",
default="smops-interp-model", metavar="",
help="What to prefix the new interpolated model name with.")
parser.add_argument("-j", "--num-threads", dest="nthreads", default=10, metavar="",
type=int, help="Number of threads to use while writing out output images")
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python =
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 sade tests
commands = flake8 smops tests

[testenv]
setenv =
Expand Down

0 comments on commit bf8b522

Please sign in to comment.