croesuslab / RCTGAN

This package implements the RC-TGAN method, which generates synthetic data from a relational database.
Other
2 stars 3 forks source link

[BUG] Initializing RCTGAN with metadata fails #9

Closed ValterH closed 1 year ago

ValterH commented 1 year ago

Following the quickstart from README produces an error. Initializing the RCTGAN model as bellow: https://github.com/croesuslab/RCTGAN/blob/33f5bc910f07a8c4003749ee69b1fed962bfca94/README.md?plain=1#L193-L196 Raises the following error:

Traceback (most recent call last):
  File ".\test.py", line 96, in <module>
    model.fit(tables)
  File "...RCTGAN\rctgan\rctgan.py", line 58, in fit
    self._model_instance = self._model(metadata, root_path, **self._model_kwargs)
TypeError: 'Metadata' object is not callable

Possible Problem

The name of the class RCTGAN in https://github.com/croesuslab/RCTGAN/blob/33f5bc910f07a8c4003749ee69b1fed962bfca94/rctgan/rctgan.py#L12 is the same as the imported one https://github.com/croesuslab/RCTGAN/blob/33f5bc910f07a8c4003749ee69b1fed962bfca94/rctgan/rctgan.py#L9

If I rename the RCTGAN class from line 12 to something else, this error is averted. However, I do not understand what the purpose of the class defined on line 12 is.

mohamedgy commented 1 year ago

Hi Valter,

Thank you for pointing that! We can fix this just by removing the line 193: «from rctgan import RCTGAN» from the example of the readme file, because the library is already imported in the previous lines «from rctgan.relational import RCTGAN».