Skip to content

Conversation

@pieterbartsmit
Copy link
Collaborator

  • added a requirements.txt for installation
  • removed the weird local scope importing I used to do and replaced with global imports
  • introduced standard "import numpy as np"
  • allow for smartmooring parsing (very rudimentary)
  • allow for parsing of files if no sys files are available (use latest defaults to try and parse).

- removed the weird local scope importing I used to do and replaced with global imports
- introduced standard "import numpy as np"
- allow for smartmooring parsing (very rudimentary)
- allow for parsing of files if no sys files are available (use latest defaults to try and parse).
@pieterbartsmit pieterbartsmit requested a review from tcj April 25, 2023 05:08
Copy link
Contributor

@tcj tcj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pieterbartsmit thanks for all the useful changes and cleanup!

I am noticing one problem, which I can dig into more later. While testing with data from SPOT-0552:

Traceback (most recent call last):
  File "/Users/tcj/src/spotter-sd-parser/sd_file_parser.py", line 1699, in <module>
    main(**arguments)
  File "/Users/tcj/src/spotter-sd-parser/sd_file_parser.py", line 553, in main
    if spectra.spectral_data_is_available:
AttributeError: 'str' object has no attribute 'spectral_data_is_available'

@randallpittman
Copy link
Contributor

@tcj - It looks like that should be spectrum.spectral_data_is_available instead of spectra.spectral_data_is_available in line 553.

diff --git a/sd_file_parser.py b/sd_file_parser.py
index 1d29dec..04e13ad 100755
--- a/sd_file_parser.py
+++ b/sd_file_parser.py
@@ -550,7 +550,7 @@ def main( path = None , outpath=None, outputFileType='CSV',
         # Generate bulk parameter file
         if bulkParameters:
             spectrum = Spectrum(path=outpath,outpath=outpath)
-            if spectra.spectral_data_is_available:
+            if spectrum.spectral_data_is_available:
                 spectrum.generate_text_file()
     #Versions
     #

@randallpittman
Copy link
Contributor

randallpittman commented Nov 3, 2023

@pieterbartsmit
Since the PR needs updating, how about also sorting the imports a la PEP8?

import fnmatch
import gzip
import os
import sys
import time

import numpy as np
import pandas as pd
from scipy import io, signal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants