Skip to content

Commit

Permalink
make installation and starting the server easier (#62)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #62

These changes will allow aepsych to be hosted on pypi and installed from pip; also allows a server to be started with a simple command

Reviewed By: mshvartsman

Differential Revision: D37176812

fbshipit-source-id: 4d34e9c5bd51918d583fd1608fbdb92d1f8a4832
  • Loading branch information
Craig Sanders authored and facebook-github-bot committed Jun 28, 2022
1 parent 906286b commit 4877b6f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
4 changes: 2 additions & 2 deletions aepsych/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import pandas as pd
import torch
from aepsych.config import Config
from aepsych.strategy import SequentialStrategy
from aepsych.server.sockets import DummySocket, createSocket
from aepsych.strategy import SequentialStrategy

logger = utils_logging.getLogger(logging.INFO)

Expand Down Expand Up @@ -845,7 +845,7 @@ def start_server(server_class, args):
raise RuntimeError(e)


def main(server_class):
def main(server_class=AEPsychServer):
args = parse_argument()
if args.logs:
# overide logger path
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
51 changes: 45 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,57 @@
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

from os import path
import os

from setuptools import setup, find_packages
from setuptools import find_packages, setup

this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "Readme.md"), encoding="utf-8") as f:
long_description = f.read()
root_dir = os.path.dirname(__file__)

REQUIRES = [
"matplotlib",
"torch",
"pyzmq==19.0.2",
"scipy",
"sklearn",
"gpytorch>=1.4",
"botorch>=0.6.1",
"SQLAlchemy",
"dill",
"pandas",
"tqdm",
"pathos",
]

DEV_REQUIRES = [
"coverage",
"flake8",
"black",
"numpy>=1.20, " "sqlalchemy-stubs", # for mypy stubs
"mypy",
"parameterized",
]

with open(os.path.join(root_dir, "README.md"), "r") as fh:
long_description = fh.read()

setup(
name="aepsych",
version="0.1",
version="0.1.0",
python_requires=">=3.8",
packages=find_packages(),
description="Adaptive experimetation for psychophysics",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=REQUIRES,
entry_points={
"console_scripts": [
"aepsych_server = aepsych.server.server:main",
],
},
)

extras_require = (
{
"dev": DEV_REQUIRES,
},
)

0 comments on commit 4877b6f

Please sign in to comment.