From 0dc4af804168bdd5106feeecb42f76d56b5b5320 Mon Sep 17 00:00:00 2001
From: petrush <petrus.hyvonen@sscspace.com>
Date: Thu, 30 Apr 2020 19:01:30 +0200
Subject: [PATCH] Changed from getInstance to getDefault for DataContext.

---
 python_files/pyhelpers.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/python_files/pyhelpers.py b/python_files/pyhelpers.py
index 32f6f74..fe1b431 100644
--- a/python_files/pyhelpers.py
+++ b/python_files/pyhelpers.py
@@ -31,7 +31,6 @@ from org.orekit.data import DataProvidersManager, ZipJarCrawler, DirectoryCrawle
 from org.orekit.time import TimeScalesFactory, AbsoluteDate
 from org.orekit.utils import ElevationMask
 
-
 try:
     import urllib.request as urlrequest
 except ImportError:
@@ -76,24 +75,24 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
 
     """
 
-    DM = DataProvidersManager.getInstance()
+    DM = DataContext.getDefault().getDataProvidersManager()
     datafile = File(filename)
     if not datafile.exists():
         print('File or folder:', datafile.absolutePath, ' not found')
         print("""
-        
+
         The Orekit library relies on some external data for physical models. 
         Typical data are the Earth Orientation Parameters and the leap seconds history, 
         both being provided by the IERS or the planetary ephemerides provided by JPL. 
         Such data is stored in text or binary files with specific formats that Orekit knows 
         how to read, and needs to be provided for the library to work.
-        
+
         You can download a starting file with this data from the orekit gitlab at:
         https://gitlab.orekit.org/orekit/orekit-data
-        
+
         or by the function:
         orekit.pyhelpers.download_orekit_data_curdir()
-        
+
         """)
 
     if os.path.isdir(filename):
@@ -103,6 +102,8 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
     else:
         print('filename ', filename, ' is neither a file nor a folder')
     DM.clearProviders()
+    DM.clearLoadedDataNames()
+    DM.clearFilters()
     DM.addProvider(crawler)
 
 
-- 
GitLab