Closed karthikraman closed 5 years ago
I'm basically trying to read a pre-written json file and dump it with floating_point_precision=4
:
TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'spatio_temporal/data')
ORIG_DATA_PATH = os.path.expanduser('~/Documents')
for fname in sys.argv[1:]:
panchangam_actual = JsonObject.read_from_file(filename=os.path.join(ORIG_DATA_PATH, fname))
panchangam_actual.dump_to_file(filename=os.path.join(TEST_DATA_PATH, fname), floating_point_precision=4)
How did you generate this file you're reading? Can you attach it here? A generally safe way to create a file is to dump a python object.
The file was generated using get_panchangam
Chennai-2019.json.gz
annual.py
1551: panchangam.dump_to_file(filename=fname)
This should have worked, right?
I think I got it.
The line 1525 in panchAngam should run in order for the reading to work.
common.update_json_class_index(sys.modules[__name__])
Which is why the reading happens properly in test_annual.py (which I updated and ran with your file) - it does:
from jyotisha.panchangam.spatio_temporal import City, annual
which runs the aforementioned line. .
Perhaps because of some wrong version?