Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/147/inverse tags #148

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading