Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst

recursive-include slddb/element_table/nabs_geant4_data *.npz
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
========================================
ORSO Scattering Length Density Data Base
========================================
.. image:: https://raw.githubusercontent.com/reflectivity/slddb/master/flaskr/static/orso_db.png
.. image:: https://raw.githubusercontent.com/reflectivity/slddb/master/slddb_server/static/orso_db.png
:width: 15em
:align: left

Expand Down
4 changes: 2 additions & 2 deletions README_TESTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ This is the development version for the SLD Database. To test on you local machi
1. Install python3 packages for periodictable, flask, bokeh
2. Set environment variables:
- PYTHONPATH to directory of repository
- FLASK_APP = flaskr
- FLASK_APP = slddb_server
3. Create database with "python3 create_database.py"
3b Expand database by materials from Christy "python3 testdata_christy.py"
4. Run "flask run" and visit http://127.0.0.1:5000/

x. To setup initial authentication for ORSO users run:
$ python -m flaskr.authentication
$ python -m slddb_server.authentication
To setup new users a valid SMTP server is required to send the activation emails.
(Defaults to mailtrap fake server for testing.)
To activate a real SMTP server set the following environment variables before starting the flask server:
Expand Down
16 changes: 11 additions & 5 deletions create_database.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from orsopy import slddb
from orsopy.slddb import __version__, dbconfig
from pathlib import Path
from slddb import dbconfig
import slddb

# for flask use database file in startup folder
DB_FILE='slddb.db';dbconfig.DB_FILE=DB_FILE;slddb.DB_FILE=DB_FILE
from orsopy.slddb import SLDDB
from orsopy.slddb.dbconfig import DB_FILE
DB_FILE = Path("instance", "slddb.db")
DB_FILE.parent.mkdir(exist_ok=True)
dbconfig.DB_FILE=DB_FILE
slddb.DB_FILE=DB_FILE

from slddb import SLDDB
from slddb.dbconfig import DB_FILE
import sqlite3

if __name__=='__main__':
Expand Down
16 changes: 10 additions & 6 deletions enter_data_christy.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
"""
Material Data from Christy Kinane's table for testing database.
"""
from pathlib import Path

from orsopy import slddb
from orsopy.slddb import __version__, dbconfig
# for flask use database file in startup folder
DB_FILE='slddb.db';dbconfig.DB_FILE=DB_FILE;slddb.DB_FILE=DB_FILE
from orsopy.slddb import SLDDB
from orsopy.slddb.dbconfig import DB_FILE
import slddb
from slddb import dbconfig
# for flask use database file in instance folder
DB_FILE = Path('instance') / 'slddb.db'
dbconfig.DB_FILE = DB_FILE
slddb.DB_FILE = DB_FILE

from slddb import SLDDB
from slddb.dbconfig import DB_FILE

data=[ ['Si', 2.33, 0.0],
['Ag', 10.49, 0.0],
Expand Down
81 changes: 0 additions & 81 deletions flaskr/api.py

This file was deleted.

176 changes: 0 additions & 176 deletions flaskr/blender.py

This file was deleted.

57 changes: 57 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "slddb"
version = "0.1.0"
authors = [
{name = "Artur Glavic", email = "artur.glavic@psi.ch"},
]
description = "Scattering Length Density Database"
readme = "README.rst"
requires-python = ">=3.8"
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"periodictable",
"numpy",
"scipy",
]

[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
]
server = [
"flask",
"flask-login",
"flask-sqlalchemy",
"flask-mail",
"cryptography",
"matplotlib",
"refnx",
"pycifrw"
]
dev = [
"black",
"isort",
"flake8",
]

[project.urls]
"Homepage" = "https://github.com/reflectivity/slddb"
"Bug Tracker" = "https://github.com/reflectivity/slddb/issues"

[tool.setuptools]
packages = ["slddb", "slddb-server"]

[tool.setuptools_scm]
# This enables automatic version numbering from Git tags
write_to = "slddb/_version.py"
Loading
Loading