Eve-ning / reamberPy

Vertical Scrolling Rhythm Game Mapping Toolbox
https://eve-ning.github.io/reamberPy/
MIT License
21 stars 1 forks source link

reamber can not convert not only 0% LN quaver map and also 0% Rice map. #125

Closed Speechless-10308 closed 1 year ago

Speechless-10308 commented 1 year ago

When I use it to convert quaver maps, I got this error:

  File "main.py", line 58, in <module>
    main()
  File "main.py", line 53, in main
    convertMap(os.path.join(input_dir, file), output_dir)
  File "main.py", line 16, in convertMap
    quaver_map = QuaMap.read_file(map_file_path)
  File "E:\Anaconda\envs\OSUconvert\lib\site-packages\reamber\quaver\QuaMap.py", line 69, in read_file
    return QuaMap.read(file)
  File "E:\Anaconda\envs\OSUconvert\lib\site-packages\reamber\quaver\QuaMap.py", line 55, in read
    m._read_notes(file.pop('HitObjects'))
  File "E:\Anaconda\envs\OSUconvert\lib\site-packages\reamber\quaver\QuaMap.py", line 110, in _read_notes
    self.holds = QuaHoldList.from_yaml(holds)
  File "E:\Anaconda\envs\OSUconvert\lib\site-packages\reamber\quaver\lists\notes\QuaHoldList.py", line 19, in from_yaml  
    df['EndTime'] -= df['StartTime']
  File "E:\Anaconda\envs\OSUconvert\lib\site-packages\pandas\core\frame.py", line 3761, in __getitem__
    indexer = self.columns.get_loc(key)
  File "E:\Anaconda\envs\OSUconvert\lib\site-packages\pandas\core\indexes\range.py", line 349, in get_loc
    raise KeyError(key)
KeyError: 'EndTime'

After analyzing it, I found the QuaMap._read_notes() method doesn't detect whether the hold and hit is empty. So, it throws the KeyError.

The example error map is this map, it is a Rice map without any LN.

Eve-ning commented 1 year ago

Hi there, thanks for narrowing down the cause of the issue, I've attached it to 0.1.9.

I'll try to deploy this version on PyPI in a few moments

Eve-ning commented 1 year ago

I've uploaded the fix, you can update your version with pip install reamber==0.1.9