Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with numpy_minmax_scaler unittest #56

Open
sgoldenCS opened this issue Nov 18, 2024 · 1 comment
Open

Issue with numpy_minmax_scaler unittest #56

sgoldenCS opened this issue Nov 18, 2024 · 1 comment
Assignees

Comments

@sgoldenCS
Copy link
Contributor

When I run the unittest for the numpy_minmax_scaler, I get the following error output:

***************************************
*                                     *
*   Unit Test: Numpy Min Max Scaler   *
*                                     *
***************************************
 
Create test data...
...done!
  
Load numpy min max scaler...
Attempting to load jlab_datascience_toolkit.data_prep.numpy_minmax_scaler with NumpyMinMaxScaler
  
***   Info: NumpyMinMaxScaler   ***
Input(s):
i) Full path to .yaml configuration file 
ii) Optional: User configuration, i.e. a python dict with additonal / alternative settings
iii) Numpy data
What this module does:
i) Scale input data with respect to a specified range
ii) Optional: reverse the scaling
Output(s):
i) Scaled .npy data
ii) Optional: unscaled .npy data
Note(s):
i) The scaler will (by default) be fitted to the data and the transform it. To disable the fitting, do: run(data,disable_fit=True)
***   Info: NumpyMinMaxScaler   ***
  
...done!
  
Scale data...
...done!
  
Reverse scaling...
...done!
  
Run sanity checks...
...done!
  
Store and retreive scaler parameters...
...done!
  
Remove created data...
E
======================================================================
ERROR: test_drive_numpy_minmax_scaler (__main__.UTestNumpyMinMaxScaler)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sgolden/Documents/GitHub/jlab_datascience_core/utests/utest_numpy_minmax_scaler.py", line 105, in test_drive_numpy_minmax_scaler
    shutil.rmtree('numpy_minmax_scaler_params')
  File "/Users/sgolden/.pyenv/versions/3.10.14/lib/python3.10/shutil.py", line 715, in rmtree
    onerror(os.lstat, path, sys.exc_info())
  File "/Users/sgolden/.pyenv/versions/3.10.14/lib/python3.10/shutil.py", line 713, in rmtree
    orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: 'numpy_minmax_scaler_params'
@sgoldenCS
Copy link
Contributor Author

Oh, I've figured it out. It expects you are running the unit test from jlab_datascience_core/utests instead of just jlab_datascience_core. It would be nice if this could be made to work without requiring the tests to run from a particular directory.

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

No branches or pull requests

2 participants