Skip to content

Commit

Permalink
Issue/147/inverse tags (#148)
Browse files Browse the repository at this point in the history
* tags inversion

* inverse tags and make tests works
  • Loading branch information
FusRoman authored Nov 27, 2023
1 parent 1e840a4 commit 5734734
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions bin/utils_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,11 @@ def assig_tags(orb_df, traj_orb_df, start_tags):
... })
>>> new_orb, new_traj = assig_tags(orb, traj, 0)
>>> orb_test = pd.read_parquet("fink_fat/test/utils_cli_test_orb.parquet")
>>> traj_test = pd.read_parquet("fink_fat/test/utils_cli_test_traj.parquet")
>>> orb_test = pd.read_parquet("fink_fat/test/utils_cli_test_orb.parquet").reset_index(drop=True)
>>> traj_test = pd.read_parquet("fink_fat/test/utils_cli_test_traj.parquet").reset_index(drop=True)
>>> assert_frame_equal(orb_test, new_orb)
>>> assert_frame_equal(traj_test, new_traj)
>>> assert_frame_equal(orb_test, new_orb.reset_index(drop=True))
>>> assert_frame_equal(traj_test, new_traj.reset_index(drop=True))
"""
orb_df = orb_df.sort_values("ref_epoch")

Expand Down
2 changes: 1 addition & 1 deletion fink_fat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.15.2"
__version__ = "0.15.3"
12 changes: 6 additions & 6 deletions fink_fat/others/id_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def int_to_tags(traj_id, jd):
Examples
--------
>>> int_to_tags(15, 2460135.98)
'FF10072023aaaaaap'
'FF20230710aaaaaap'
>>> int_to_tags(27, 2460135.98)
'FF10072023aaaaabb'
'FF20230710aaaaabb'
>>> int_to_tags(652, 2460135.98)
'FF10072023aaaaazc'
'FF20230710aaaaazc'
"""
res_tag = ""
for _ in range(7):
Expand All @@ -43,8 +43,8 @@ def int_to_tags(traj_id, jd):
traj_id = q

discovery = Time(jd, format="jd").datetime
return "FF{:02d}{:02d}{}{}".format(
discovery.day, discovery.month, discovery.year, res_tag[::-1]
return "FF{:04d}{:02d}{:02d}{}".format(
discovery.year, discovery.month, discovery.day, res_tag[::-1]
)


Expand All @@ -70,7 +70,7 @@ def generate_tags(begin, end, jd):
Examples
--------
>>> generate_tags(3, 6, [2460135.42, 2460137.57, 2460148.72])
['FF09072023aaaaaad', 'FF12072023aaaaaae', 'FF23072023aaaaaaf']
['FF20230709aaaaaad', 'FF20230712aaaaaae', 'FF20230723aaaaaaf']
"""
return [int_to_tags(i, date) for date, i in zip(jd, np.arange(begin, end))]

Expand Down
Binary file modified fink_fat/test/cli_test/fink_fat_out_test/mpc/orbital.parquet
Binary file not shown.
Binary file not shown.
Binary file modified fink_fat/test/utils_cli_test_orb.parquet
Binary file not shown.
Binary file modified fink_fat/test/utils_cli_test_traj.parquet
Binary file not shown.

0 comments on commit 5734734

Please sign in to comment.