Skip to content

Commit

Permalink
Merge pull request #275 from ISISNeutronMuon/chi/restructuring
Browse files Browse the repository at this point in the history
Restructured code and other small changes
  • Loading branch information
MBartkowiakSTFC authored Jan 12, 2024
2 parents 95f8391 + ba97a4a commit 2dbf415
Show file tree
Hide file tree
Showing 546 changed files with 111 additions and 123 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: (cd MDANSE && python -m pip install -r requirements.txt)

- name: Build wheels
run: (cd MDANSE && python setup.py bdist_wheel)
run: (cd MDANSE && python -m build)
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
run: (cd MDANSE_GUI && python -m pip install -r requirements.txt)

- name: Build wheels
run: (cd MDANSE_GUI && python setup.py bdist_wheel)
run: (cd MDANSE_GUI && python -m build)
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value
Expand Down
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,30 @@
.pydevproject
.settings
.vscode
MANIFEST
*.pyc

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# extensions
*.pyd

# pycharm
.idea
8 changes: 4 additions & 4 deletions MDANSE/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include LICENSE
include LICENCE
include requirements.txt

recursive-include Extensions/qhull_lib *.h *c *.pxd
recursive-include Extensions/xtc *.h *c *.pxd
recursive-include Src/MDANSE/Chemistry *.json
recursive-include Src/MDANSE/Framework *.json

recursive-include Doc *

include Scripts/*

recursive-include Tests *.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions MDANSE/Scripts/mdanse → MDANSE/Src/MDANSE/Scripts/mdanse.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

# **************************************************************************
#
# MDANSE: Molecular Dynamics Analysis for Neutron Scattering Experiments
Expand Down Expand Up @@ -384,7 +382,7 @@ def save_job_template(self, option, opt_str, value, parser):
return


if __name__ == "__main__":
def main():
from MDANSE.__pkginfo__ import __version__, __date__

# Creates the option parser.
Expand Down Expand Up @@ -457,3 +455,7 @@ def save_job_template(self, option, opt_str, value, parser):

# The command line is parsed.
options, _ = parser.parse_args()


if __name__ == "__main__":
main()
8 changes: 5 additions & 3 deletions MDANSE/Scripts/mdanse_job → MDANSE/Src/MDANSE/Scripts/mdanse_job.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

# **************************************************************************
#
# MDANSE: Molecular Dynamics Analysis for Neutron Scattering Experiments
Expand Down Expand Up @@ -39,7 +37,7 @@ def parse_args():
return args


if __name__ == "__main__":
def main():
from MDANSE import REGISTRY
from MDANSE.GUI.Apps import JobApp

Expand All @@ -60,3 +58,7 @@ def parse_args():

app = JobApp(job, trajectory)
app.MainLoop()


if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion MDANSE/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ documentation = "https://mdanse.readthedocs.io/en/latest/"
repository = "https://github.com/ISISNeutronMuon/MDANSE"

[tool.setuptools]
package-dir = {"MDANSE" = "src"}
package-dir = {"" = "src"}

[project.scripts]
mdanse = "MDANSE.Scripts.mdanse:main"
mdanse_job = "MDANSE.Scripts.mdanse_job:main"

# [tool.setuptools.packages.find]
# where = ["src"]
41 changes: 4 additions & 37 deletions MDANSE/setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import fnmatch
import glob
import os
import subprocess
import sys

import numpy

from setuptools import setup, Extension
from setuptools import setup, Extension, find_packages
from Cython.Distutils import build_ext as cython_build_ext

from pip._internal.req import parse_requirements
from pip._internal.network.session import PipSession
from distutils.command.build import build

# from distutils.core import setup, Extension
from distutils.sysconfig import get_config_vars
from distutils.util import convert_path

Expand Down Expand Up @@ -73,19 +69,6 @@ def is_package(path):
return os.path.isdir(path) and os.path.isfile(os.path.join(path, "__init__.py"))


def find_packages(path, base=None, exclude=None):
packages = []

for root, dirs, files in os.walk(path):
if "__init__.py" in files:
if base is not None:
root = root.replace(path, base)
package = root.replace(os.sep, ".")
packages.append(package)

return packages


def find_package_data(
where=".",
package="",
Expand Down Expand Up @@ -179,16 +162,8 @@ def find_data(
#################################

PACKAGE_INFO = {}
exec(open("Src/__pkginfo__.py", "r").read(), {}, PACKAGE_INFO)

PACKAGES = find_packages(path="Src", base="MDANSE")
exec(open("Src/MDANSE/__pkginfo__.py", "r").read(), {}, PACKAGE_INFO)

#################################
# Package data section
#################################

# Retrieve all the data related to the MDANSE package.
PACKAGE_DATA = find_package_data(where="Src", package="MDANSE", show_ignored=False)

#################################
# User data section
Expand All @@ -197,12 +172,6 @@ def find_data(
DATA_FILES = []
DATA_FILES.extend(find_data("Doc", exclude=[], prefix="conf_"))

#################################
# Scripts section
#################################

SCRIPTS_PATH = "Scripts"
SCRIPTS = glob.glob(os.path.join(SCRIPTS_PATH, "mdanse*"))

#################################
# Documentation
Expand Down Expand Up @@ -418,13 +387,11 @@ class mdanse_build_api(mdanse_build_doc):
maintainer_email=PACKAGE_INFO["__maintainer_email__"],
url=PACKAGE_INFO["__url__"],
license=PACKAGE_INFO["__license__"],
packages=PACKAGES,
package_data=PACKAGE_DATA,
package_dir={"MDANSE": "Src"},
packages=find_packages("Src"),
package_dir={"": "Src"},
data_files=DATA_FILES,
platforms=["Unix", "Windows"],
ext_modules=EXTENSIONS,
scripts=SCRIPTS,
cmdclass=CMDCLASS,
# entry_points = {"console_scripts": []}
install_requires=[
Expand Down
11 changes: 4 additions & 7 deletions MDANSE_GUI/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
include LICENSE
include LICENCE
include requirements.txt

recursive-include Src/GUI/Resources/Icons *.png

recursive-include Src/PyQtGUI/Icons *.png
recursive-include Src/MDANSE_GUI/GUI/Resources/Icons *.png
recursive-include Src/MDANSE_GUI/PyQtGUI/Icons *.png
recursive-include Src/MDANSE_GUI/PyQtGUI/MolecularViewer/database *.yml

recursive-include Doc *

include Scripts/*

recursive-include Tests *.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Loading

0 comments on commit 2dbf415

Please sign in to comment.