Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

SCF sampling code #4

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Global options:

[mypy]
python_version = 3.8

disallow_untyped_defs = True
no_implicit_reexport = True

warn_unused_configs = True
warn_redundant_casts = True
warn_unused_ignores = True
no_warn_no_return = True
warn_return_any = True
warn_unreachable = True

plugins = numpy.typing.mypy_plugin


#######################################
# Per-module options:

[mypy-*/tests.*]
ignore_errors = True

#######################################
# missing imports

[mypy-astropy.*]
ignore_missing_imports = True

[mypy-numpy.*]
ignore_missing_imports = True

[mypy-matplotlib.*]
ignore_missing_imports = True

[mypy-galpy.*]
ignore_missing_imports = True

[mypy-pytest.*]
ignore_missing_imports = True

[mypy-pytest_astropy_header.display]
ignore_missing_imports = True

[mypy-scipy.*]
ignore_missing_imports = True

[mypy-setuptools_scm.*]
ignore_missing_imports = True
30 changes: 2 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Self-Consistent Field (SCF).
License
-------

This project is Copyright (c) nathaniel starkman and licensed under
the terms of the BSD 3-Clause license. This package is based upon
This project is Copyright (c) Nathaniel Starkman and Maintainers and licensed
under the terms of the BSD 3-Clause license. This package is based upon
the `Astropy package template <https://github.com/astropy/package-template>`_
which is licensed under the BSD 3-clause license. See the licenses folder for
more information.
Expand All @@ -25,29 +25,3 @@ Contributing

We love contributions! sampleSCF is open source,
built on open source, and we'd love to have you hang out in our community.

**Imposter syndrome disclaimer**: We want your help. No, really.

There may be a little voice inside your head that is telling you that you're not
ready to be an open source contributor; that your skills aren't nearly good
enough to contribute. What could you possibly offer a project like this one?

We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one's coding skills. Writing perfect code
isn't the measure of a good developer (that would disqualify all of us!); it's
trying to create something, making mistakes, and learning from those
mistakes. That's how we all improve, and we are happy to help others learn.

Being an open source contributor doesn't just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you're coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.

Note: This disclaimer was originally written by
`Adrienne Lowe <https://github.com/adriennefriend>`_ for a
`PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by
sampleSCF based on its use in the README file for the
`MetPy project <https://github.com/Unidata/MetPy>`_.
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Thus, any C-extensions that are needed to build the documentation will *not*
# be accessible, and the documentation will not build correctly.

# BUILT-IN
# STDLIB
import datetime
import os
import sys
Expand Down Expand Up @@ -146,7 +146,9 @@

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [("index", project + ".tex", project + u" Documentation", author, "manual")]
latex_documents = [
("index", project + ".tex", project + u" Documentation", author, "manual"),
]


# -- Options for manual page output -------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Documentation
=============

This is the documentation for sampleSCF.

.. toctree::
:maxdepth: 2

sample_scf/index.rst

.. note:: The layout of this directory is simply a suggestion. To follow
traditional practice, do *not* edit this page, but instead place
all documentation for the package inside ``sample_scf/``.
You can follow this practice or choose your own layout.
10 changes: 10 additions & 0 deletions docs/sample_scf/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
***********************
sampleSCF Documentation
***********************

This is the documentation for sampleSCF.

Reference/API
=============

.. automodapi:: sample_scf
27 changes: 12 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[build-system]

requires = ["extension-helpers",
"setuptools",
"setuptools_scm",
Expand All @@ -8,21 +7,19 @@ requires = ["extension-helpers",
build-backend = 'setuptools.build_meta'

[tool.isort]
line_length = 100
multi_line_output = 3
include_trailing_comma = "True"
force_grid_wrap = 0
use_parentheses = "True"
ensure_newline_before_comments = "True"
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]

known_third_party = ["astropy", "extension_helpers", "setuptools"]
known_localfolder = "sample_scf"
profile = "black"
include_trailing_comma = "True"
force_grid_wrap = 0
use_parentheses = "True"
ensure_newline_before_comments = "True"
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_third_party = ["astropy", "extension_helpers", "galpy", "matplotlib", "numpy", "pytest", "scipy", "setuptools"]
known_localfolder = "sample_scf"

import_heading_stdlib = "BUILT-IN"
import_heading_thirdparty = "THIRD PARTY"
import_heading_firstparty = "FIRST PARTY"
import_heading_localfolder = "LOCAL"
import_heading_stdlib = "STDLIB"
import_heading_thirdparty = "THIRD PARTY"
import_heading_firstparty = "FIRST PARTY"
import_heading_localfolder = "LOCAL"

[tool.black]
line-length = 100
Expand Down
11 changes: 11 additions & 0 deletions sample_scf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@

# LOCAL
from sample_scf._astropy_init import * # isort: +split # noqa: F401, F403
from sample_scf.core import SCFSampler
from sample_scf.exact import ExactSCFSampler
from sample_scf.interpolated import InterpolatedSCFSampler
from sample_scf.representation import FiniteSphericalRepresentation

__all__ = [
"SCFSampler",
"ExactSCFSampler",
"InterpolatedSCFSampler",
"FiniteSphericalRepresentation",
]
2 changes: 1 addition & 1 deletion sample_scf/_astropy_init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# BUILT-IN
# STDLIB
import os

__all__ = ["__version__", "test"]
Expand Down
21 changes: 21 additions & 0 deletions sample_scf/_typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst

"""Custom typing."""

# STDLIB
from typing import Union

# THIRD PARTY
from numpy import floating
from numpy.random import Generator, RandomState
from numpy.typing import NDArray

__all__ = ["RandomGenerator", "RandomLike", "NDArrayF", "FArrayLike"]

RandomGenerator = Union[RandomState, Generator]
RandomLike = Union[None, int, RandomGenerator]
NDArrayF = NDArray[floating]

# float array-like
FArrayLike = Union[float, NDArrayF]
Loading