-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
64 lines (58 loc) · 1.96 KB
/
setup.bat
File metadata and controls
64 lines (58 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@echo off
REM Installation script for TopSpin Python API Wrapper
REM This script sets up the Python environment and installs dependencies
echo ========================================
echo TopSpin Python API Wrapper - Setup
echo ========================================
echo.
REM Check if uv is installed
where uv >nul 2>nul
if %errorlevel% neq 0 (
echo [ERROR] uv is not installed!
echo Please install uv first:
echo pip install uv
echo.
exit /b 1
)
echo [1/4] Installing Python dependencies...
uv pip install numpy xarray matplotlib adjustText
if %errorlevel% neq 0 (
echo [ERROR] Failed to install Python dependencies
exit /b 1
)
echo [OK] Python dependencies installed
echo.
echo [2/4] Installing TopSpin API package...
REM Install TopSpin API from TopSpin installation directory
if exist "D:\topspin\python\examples\bruker_nmr_api-2.1.0-py3-none-any.whl" (
uv pip install "D:\topspin\python\examples\bruker_nmr_api-2.1.0-py3-none-any.whl"
if %errorlevel% neq 0 (
echo [ERROR] Failed to install TopSpin API package
exit /b 1
)
echo [OK] TopSpin API package installed
) else (
echo [WARNING] TopSpin API package not found at D:\topspin\python\examples\
echo Please ensure TopSpin is installed at D:\topspin
echo Or modify the path in this script to match your TopSpin installation.
)
echo.
echo [3/4] Creating example pulse sequence for testing...
if not exist "test_pulseprogram" mkdir test_pulseprogram
echo ========================================
echo Installation completed successfully!
echo ========================================
echo.
echo Next steps:
echo 1. Activate the virtual environment:
echo .venv\Scripts\activate
echo.
echo 2. Test the installation:
echo python topspin_api.py
echo.
echo 3. Run examples:
echo python example_pulse_sequence.py
echo.
echo 4. Open a pulse sequence:
echo python example_pulse_sequence.py D:\topspin\examdata\Cyclosporine\1\pulseprogram
echo.