Skip to content

Commit

Permalink
Merge pull request #21 from slaclab/development
Browse files Browse the repository at this point in the history
Development into main
  • Loading branch information
nstelter-slac authored Feb 20, 2024
2 parents e07def8 + 8fad691 commit e49943f
Show file tree
Hide file tree
Showing 47 changed files with 44 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
pip install scipy
pip install statsmodels
# - name: Run tests
# run: |
# pytest tests/test_FitFunctions.py
- name: Run tests
run: |
pytest tests/test_FitFunctions.py
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
# beamtime-calibration-suite
[![Build Status](https://github.com/slaclab/beamtime-calibration-suite/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/slaclab/beamtime-calibration-suite/actions/workflows/run-tests.yml)

To run tests:
ssh into psana
source /sdf/group/lcls/ds/ana/sw/conda2/manage/bin/psconda.sh
clone this repo
cd beamtime-calibration-suite/tests
pytest .
To run any suite_scripts or use the library in scripts outside the project directory, you need to append the project directory to your PYTHONPATH, for example:
export PYTHONPATH="${PYTHONPATH}:~/beamtime_slaclab/beamtime-calibration-suite"

(can add this to your ~/.bashrc so persists between terminal sessions. Library can later have
a better release method than cloning and adding to path (pip?))

File organization:
/calibrationSuite: The library code lives here, and the functions can be imported into other scripts as such:

from calibrationSuite.basicSuiteScript import *
from calibrationSuite.fitFunctions import *
from calibrationSuite.Stats import *
from calibrationSuite.cluster import *

(documentation on the library functionality is still to come, but example usage is seen in the /suite_scripts folder)

/suite_scripts: scripts that use the calibrationSuite library code

/standalone_scripts: scripts that do not use the calibrationSuite library code

/tests: tests files, can be ran with 'pytest .' from the root project directory
(Currently only test for the fitFunctions libraryh file is running, more tests are to be added)


Current Status:

main branch tag v1.0.0 are the scripts used for the 2/17/24 beamtime
-only changes made are to file organization, and to import statements so work with new organization
-large changes will be merged into ontop of this, but original scripts can be accessed by checking out this tag
-future beamtimes can be tagged as well

Developers:

If you are new to git/github, start here: https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=428802060

Then read the following for an overview of the development process: https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=429562464
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import h5py
import numpy as np
import fitFunctions, ancillaryMethods
import calibrationSuite.fitFunctions, calibrationSuite.ancillaryMethods
##import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
Expand Down
2 changes: 1 addition & 1 deletion suite_scripts/CalcNoise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from calibrationSuite.basicSuiteScript import *
import Stats
import calibrationSuite.Stats

class CalcNoise(BasicSuiteScript):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion suite_scripts/CalcNoiseAndMean.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from calibrationSuite.basicSuiteScript import *
import Stats
import calibrationSuite.Stats

class CalcNoise(BasicSuiteScript):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion suite_scripts/SimpleClustersParallel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from calibrationSuite.basicSuiteScript import *
from cluster import Cluster, BuildClusters
from calibrationSuite.cluster import Cluster, BuildClusters

class SimpleClusters(BasicSuiteScript):
def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import matplotlib.pyplot as plt
import numpy as np
import fitFunctions, ancillaryMethods
import calibrationSuite.fitFunctions, calibrationSuite.ancillaryMethods
import sys

class AnalyzeLinearity(object):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e49943f

Please sign in to comment.